Question: 2. Given a queue implementation linear array, named bg with the size of the array equal to 4 a. Assume queue bg contains data as


2. Given a queue implementation linear array, named bg with the size of the array equal to 4 a. Assume queue bg contains data as in the figure below, show the content of bg after all operations in questions i - vii has been implemented. Give the value for front, back, status and item. Identify the status as 'FULL', 'EMPTY', insert Success/Fail or delete Success/Fail. DATA STRUCTURES AND ALGORITHMS front = 1 [3] [2] [1] [0] T o back = 2 i. item = bg.deQueue (); Status - front - (3) [2] (1) (0) item = back - ii. bg.onQueueQ('0'); Status = front - [3] [2] (1) [0] back iii. bg.onQueue ('P'); Status = front- (3) [2] (1) (0) back - iv. item - bg.de Queue (); Status front = [3] [2] (1) [0] item= back = v. item = bg.de Queue (); Status = front = [3] [2] [1] [0] item = back = vi. bg.enQueue ('G'); Status = Front = [3] [2] [1] [0] back = vii. item = bg.deQueue (); muum mumm Status = front = item = back = b. State the problem occur in the queue implementation linear array in question a and explain how the problem can be solved
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
