711 views
2 votes
2 votes

Which of the following is true about linked list implementation of Queue?

<a>.In push operation,if new nodes are inserted at the end of the linked list,then pop operation removes nodes from the beginning

<b>.In push operation,if new nodes are inserted at the beginning of the linked list,then pop operation removes nodes from the end

<c>.Both

<d>.None

1 Answer

2 votes
2 votes

Since, Queue follows FIFO strategy. If insertion is done at the beginning, deletion should be done from the last and if the insertion is done at the last, the deletion must be done from the starting of the linked list.

So, Option 'C' is correct.

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
3 answers
2
Nishikant kumar asked Dec 26, 2015
11,867 views
which of the following is not O(1) for an array of sorted integers.Assume all are distinct..<a>find the ith smallest element<b>find the ith largest element<c>delete an el...