29 lines
816 B
Java
29 lines
816 B
Java
package VL13.Aufgabe02;
|
|
|
|
/**
|
|
* Vorlesung 13 / Aufgabe 2
|
|
*
|
|
* @author Sebastian Brosch
|
|
*/
|
|
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 - Interne 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 - Interne Größe: %d\n", integerQueue.size(), integerQueue.internalSize());
|
|
}
|
|
}
|
|
}
|