class Fronta { private class Prvek { private int index; private char znak; Prvek dalsi; public Prvek(int index, char znak) { this.index = index; this.znak = znak; } } private Prvek f, posledni; private int count = 0; public Fronta() { this.f = this.posledni = null; } public void Push(char znak) { count++; if (this.isEmpty()) { this.posledni = new Prvek(count, znak); this.f = this.posledni; } else { this.posledni.dalsi = new Prvek(count, znak); this.posledni = this.posledni.dalsi; } } public char Pop() { char znak = this.f.znak; this.f = this.f.dalsi; return znak; } public boolean isEmpty() { return (this.f == null); } public String PrintContent() { String obsah = new String(); Prvek x = this.f; if (this.isEmpty()) return ""; do { obsah+= x.index + " "; } while ((x=x.dalsi)!=null); return obsah; } } public class Pr03 { public static void Tiskni(String line) { System.out.println(line); } public static void Tiskni(String line, boolean newline) { if (newline) { System.out.println(line); } else { System.out.print(line); } } public static void main(String[] args) { char znak, popznak; boolean isErr = false; Fronta queue = new Fronta(); String radek = VstupData.ctiString(); for(int i=0;i