COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Two variables used in queue are ____
|
top and down
|
|
rear and front
|
|
left and right
|
|
rear and top
|
Explanation:
Detailed explanation-1: -The variable FRONT is used to identify the position of the first element in the queue, and variable REAR is used to identify the position of the last element of the queue.
Detailed explanation-2: -There are two variables i.e. front and rear, that are implemented in the case of every queue. Front and rear variables point to the position from where insertions and deletions are performed in a queue.
Detailed explanation-3: -In the beginning when the queue is empty, FRONT and REAR point to 0 index in the array. REAR represents insertion at the REAR index.
Detailed explanation-4: -Basic Operations of Queue Enqueue: Add an element to the end of the queue. Dequeue: Remove an element from the front of the queue.
There is 1 question to complete.