Question: 4. Queue is a linear data structure that implements First-In First-Out (FIFO). It can be implemented using array and also singly-linked list. Suppose Figure 2

 4. Queue is a linear data structure that implements First-In First-Out

4. Queue is a linear data structure that implements First-In First-Out (FIFO). It can be implemented using array and also singly-linked list. Suppose Figure 2 shows a queue that is implemented using circular array with front index at 3 and rear (or back) index at 1. a. [2 marks] Draw the singly linked-list illustrating the original queue in Figure 2. b. [1 mark] Determine the size (number of items) in the queue in Figure 2 . c. [1 mark] Determine the front index and rear index if enqueue (21) is performed on the queue in Figure 2. d. [1 mark] Using circular array, when rear index = front index 1 , the queue is considered full. The same situation is also observed when the queue is empty. Explain how to distinguish between these two situations (queue is full and empty)

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!