711 views
0 votes
0 votes

A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operations can be performed in O(1)O(1) time?

I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.


A. (I) only.
B. (II) only.
C. Both (I) and (II).
D. Neither (I) nor (II).

In this,if B is the answer,then how it is called singly linked list? It becomes circular linked list,and if have both front and rear pointer given,so any way it would take O(1) time only even without pointing the next pointer of rear node to front. We dont need to do this. So why B is the correct answer?D should be correct ? please explain.

1 Answer

0 votes
0 votes
in case of TWO nodes only both the statements are appearing correct. However more than two nodes option B appears to be correct one.

Related questions

0 votes
0 votes
0 answers
1
Gaurav Nagar asked Aug 11, 2018
452 views
Hey guys, please let me know if there is any institute spot round still open in any nit or iiit?My gate score is 614 in obc category
0 votes
0 votes
0 answers
3
Gaurav Kadyan asked Nov 10, 2023
217 views
If a square matrix of order 100 has exactly 15 distinct eigen values, the degree of the minimal polynomial is (a) At least 15 (c) Always 15 (b) At most 15 (d) Exactly 100...
1 votes
1 votes
3 answers
4