-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMyQueue.java
More file actions
28 lines (22 loc) · 886 Bytes
/
Copy pathMyQueue.java
File metadata and controls
28 lines (22 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package data_structures.queues.array_queue;
public class MyQueue {
public static void main(String[] args) {
Employee janeJones = new Employee("Jane", "Jones", 123);
Employee johnDoe = new Employee("John", "Doe", 4567);
Employee marySmith = new Employee("Mary", "Smith", 22);
Employee mikeWilson = new Employee("Mike", "Wilson", 3245);
Employee billEnd = new Employee("Bill", "End", 78);
ArrayQueue queue = new ArrayQueue(10);
queue.add(janeJones);
queue.add(johnDoe);
queue.add(marySmith);
queue.add(billEnd);
queue.remove();
queue.remove();
queue.add(mikeWilson);
queue.printQueue();
System.out.println("peaking: " + queue.peek());
System.out.println("removing: " + queue.remove());
System.out.println("peaking: " + queue.peek());
}
}