24 lines
733 B
Java
24 lines
733 B
Java
package VL13.Aufgabe02;
|
|
|
|
public class Aufgabe02 {
|
|
public static void main(String[] args) {
|
|
MyQueue<Integer> integerQueue = new MyQueue<Integer>();
|
|
|
|
// fill the queue with some values.
|
|
System.out.printf("\n%s:\n", "Aufbau der Queue");
|
|
|
|
for (int i = 0; i < 150; i++) {
|
|
integerQueue.add(i);
|
|
System.out.printf("Elemente: %d - Größe: %d\n", integerQueue.size(), integerQueue.internalSize());
|
|
}
|
|
|
|
// clear the queue to check the resizing of the internal storage.
|
|
System.out.printf("\n%s:\n", "Abbau der Queue");
|
|
|
|
while (integerQueue.size() > 0) {
|
|
integerQueue.get();
|
|
System.out.printf("Elemente: %d - Größe: %d\n", integerQueue.size(), integerQueue.internalSize());
|
|
}
|
|
}
|
|
}
|