+1 vote
in Data Structures & Algorithms I by (110k points)
Which of the following is true about linked list implementation of queue?

(a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end

(b) In push operation, if new nodes are inserted at the beginning, then in pop operation, nodes must be removed from the beginning

(c) In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from end

(d) In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from beginning

My question is taken from Queue using Linked List in portion Abstract Data Types of Data Structures & Algorithms I

I got this question in class test.

1 Answer

+1 vote
by (412k points)
selected by
 
Best answer
The correct answer is (a) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end

The best explanation: It can be done by both the methods.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...