MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A queue of characters currently contained a, b, c, d. What would be the contents of queue after the following operationDELETE, ADD W, ADD X, DELETE, ADD Y.
A
A, B, C, W, Y
B
A, B, C, D, W
C
C, D, W, X, Y
D
W, Y, X, C, D
Explanation: 

Detailed explanation-1: -Insertion and deletion in queues takes place from the opposite ends of the list. The insertion takes place at the rear of the list and the deletion takes place from the front of the list. Insert operation is called push operation. Insert operation is called enqueue operation.

Detailed explanation-2: -Explanation: The answer is b, i.e., Underflow. Before deleting an element from the Queue, we first need to check whether the Queue is empty or not.

Detailed explanation-3: -Which of the following is not the type of queue? Answer-B) Single Ended Queue is not a type of queue.

Detailed explanation-4: -Queues use two ends of the structure; stacks use only one.

There is 1 question to complete.