CSE 214 Lecture 4: Queues
Document Summary
A queue is a sequence of data elements (of the same type) arranged one after another conceptually. An element can be added to the rear of the queue only (enqueue) An element can be removed from the front of the queue only (dequeue) Telecommunications and transportation engineering: modeling and simulation of computer and phone networks, raod systems and transportaiton hubs. Constructor: create an empty queue isempty: is the queue empty. Enqueue: insert an elment on to the rear of the queue (if the queue is not full) Dequeue: remove the front element from the queue (if the queue is not empty) 9 public class intqueue implements cloneable{ public final int capacity = 100; private int[] data; private int front; private int rear; // intqueue methods public intqueue(){ front = -1; 37 else front = (front + 1) % capacity; 9 public class intqueue implements cloneable{ private intnode front; private intnode rear;