110 likes | 348 Views
Cousin of the Stack. The Queue Data Structure. Examples of Queues. An abstract data type (container class) in which items are entered at one end and removed from the other end First In First Out (FIFO) No standard queue terminology Insertion operations may be called:
E N D
Cousin of the Stack The Queue Data Structure
An abstract data type (container class) in which items are entered at one end and removed from the other end • First In First Out (FIFO) • No standard queue terminology • Insertion operations may be called: • enqueue, enque, enq, enter or insert • Deletion operations may be called: • dequeue, deque, deq, delete or remove Queue
Array? Linked List? How To implement the Queue
Singly linked? Doubly linked? Linked List
Which End is FRONT of list? • Strategy A: Tail is Front • Strategy B: Head is Front Singly Linked List Delete at tail of list Insert at tail of list Insert at head of list Delete at head of list