VL-Programmieren/VL13/Aufgabe02/Aufgabe02.java

29 lines
816 B
Java
Raw Normal View History

2024-05-07 18:55:35 +00:00
package VL13.Aufgabe02;
2024-05-07 21:06:51 +00:00
/**
* Vorlesung 13 / Aufgabe 2
*
* @author Sebastian Brosch
*/
2024-05-07 18:55:35 +00:00
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);
2024-05-08 10:37:30 +00:00
System.out.printf("Elemente: %d - Interne Größe: %d\n", integerQueue.size(), integerQueue.internalSize());
2024-05-07 18:55:35 +00:00
}
// 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();
2024-05-08 10:37:30 +00:00
System.out.printf("Elemente: %d - Interne Größe: %d\n", integerQueue.size(), integerQueue.internalSize());
2024-05-07 18:55:35 +00:00
}
}
}