Problem 1: Consider an array-based queue implementation. Suppose we wish to use an extra bit in queue records to indicate whether a queue is empty. 1. Modify the declarations and operations for a circular queue to accommodate this feature. 2. Would you expect the change to be worthwhile?
Problem 1: Consider an array-based queue implementation. Suppose we wish to use an extra bit
in queue records to indicate whether a queue is empty.
1. Modify the declarations and operations for a circular queue to accommodate this feature.
2. Would you expect the change to be worthwhile?
Problem 2: Consider an array-based queue implementation. A variant of the circular queue
records the position of the front element and the length of the queue.
1. Is it necessary in this implementation to limit the length of a queue to maxlength - 1?
2. Write the five queue operations for this implementation.
3. Compare this implementation with the circular queue implementation discussed in class.
Problem 3: A dequeue (double-ended queue) is a list from which elements can be inserted or
deleted at either end.
1. Develop an array-based implementation for dequeue.
2. Develop a pointer-based implementation for dequeue.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images