61 lines
1.2 KiB
Java
61 lines
1.2 KiB
Java
public class Start{
|
|
|
|
public static void main(String[] args) {
|
|
|
|
System.out.println("Liste:");
|
|
Listikus<Integer> L = new Listikus<Integer>();
|
|
L.add(1);
|
|
L.add(2);
|
|
L.add(3);
|
|
L.add(4);
|
|
L.add(5);
|
|
Node<Integer> current = L.getStart();
|
|
while(current != null) {
|
|
|
|
System.out.println(current.wert);
|
|
current = current.next;
|
|
}
|
|
|
|
System.out.println();
|
|
System.out.println("Queue:");
|
|
Queue<Integer> Q = new Queue<Integer>();
|
|
Q.enqueue(1);
|
|
Q.enqueue(2);
|
|
Q.enqueue(3);
|
|
Q.enqueue(4);
|
|
Q.enqueue(5);
|
|
Node<Integer> cur = Q.getStart();
|
|
while(cur != null) {
|
|
|
|
System.out.println(cur.wert);
|
|
cur = cur.next;
|
|
}
|
|
System.out.println();
|
|
System.out.println(Q.dequeue());
|
|
System.out.println();
|
|
cur = Q.getStart();
|
|
while(cur != null) {
|
|
|
|
System.out.println(cur.wert);
|
|
cur = cur.next;
|
|
}
|
|
System.out.println();
|
|
System.out.println(Q.front());
|
|
|
|
System.out.println();
|
|
System.out.println("Stack:");
|
|
Stack<Integer> S = new Stack<Integer>();
|
|
S.push(1);
|
|
S.push(2);
|
|
S.push(3);
|
|
S.push(4);
|
|
S.push(5);
|
|
Node<Integer> curren = S.getStart();
|
|
while(curren != null) {
|
|
|
|
System.out.println(curren.wert);
|
|
curren = curren.next;
|
|
}
|
|
}
|
|
}
|