Question: 2. (a) A bounded queue can be implemented using an array. i. The following diagram shows an example queue implemented using an ordinary array (i.e.

 2. (a) A bounded queue can be implemented using an array.

2. (a) A bounded queue can be implemented using an array. i. The following diagram shows an example queue implemented using an ordinary array (i.e. front rear): front = 1 2 rear =3 4 5 Lisa Bart Marge Redraw the diagram showing the queue status after inserting 'Maggie' and a deletion. ii. Explain a drawback of the queue implementation based on an ordinary array, using big-O notation. iii. One can avoid the problem of the ordinary array-based implementation if a dif- ferent kind of an array is used. Explain this, using big-O notation. (b) Consider an unknown data structure and the following operations, where a letter represents an insertion of that letter into the data structure and the asterisk * means extracting and printing one number: PGU * YA* **BHO * XR** The data structure is initially empty. The output resulting from these operations is: UA Y GORXH What is the data structure? Choose one structure amongst the following: a map, a queue, a stack, and a set. Justify your answer. (c) If a stack is to be implemented using a linked list, will you use a singly-linked list or a doubly-linked list? Justify your answer, using big-O notation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!