MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
If the elements ‘T’, ‘H’, ‘E’, ‘V’, and ‘A’ are placed in a queue and are deleted one at a time what will be the order when removed?
A
T H E V A
B
A V E H T
C
H E V A T
D
None of the above
Explanation: 

Detailed explanation-1: -Explanation: Element first added in queue will be deleted first which is FIFO principle.

Detailed explanation-2: -The restrictions on queue imply that the first element which is inserted into the queue will be the first one to be removed. Thus A is the first letter to be removed, and queues are known as First In First Out (FIFO) lists.

Detailed explanation-3: -Deletion from queue Whenever any element is deleted from queue, it is always done from front position. Element pointed out by front variable is deleted (if needed or left as it is) and value of front is incremented by 1.

Detailed explanation-4: -1 Answer. The best I can explain: Queue follows FIFO approach. i.e. First in First Out Approach. So, the order of removal elements are ABCD.

There is 1 question to complete.