









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Real-World Applications Computer Science Applications Recognizing palindromes
2.1 Queue : Linear Array Implementation Queue front rear items createQueue() destroyQueue() isEmpty(); isFull(); enQueue(); deQueue(); getFront(); getRear();
0 1 2 3 …. maxQ- 1 2.3 createQueue() operation
Initial state for a queue linear array 2.4 Queue operations
1 // Program 9. char queue:: getFront() // get item at front { return items[front] ; }
2.5 Linear Queue Array Problem: Rightward-Drifting
4.1 Pointer-Based Implementation
tempPtr - > next = NULL delete tempPtr ; o If the queue contains one item only, need to add this statement 1 //Program 9. 2 if (!frontPtr) 3 backPtr = NULL; 5.2 Circular linear linked list with one external pointer
§ More efficient in insert and delete operations § More complicated than Abstract Data Type (ADT) list § Most flexible, since no size restrictions