In a circularly linked list organization, insertion of a record involves the modification of 

This question was previously asked in
ESE Electronics 2014 Paper 2: Official Paper
View all UPSC IES Papers >
  1. No pointer
  2. 1 pointer 
  3. 2 pointers 
  4. 3 pointers

Answer (Detailed Solution Below)

Option 3 : 2 pointers 
Free
ST 1: UPSC ESE (IES) Civil - Building Materials
6.2 K Users
20 Questions 40 Marks 24 Mins

Detailed Solution

Download Solution PDF

Circular linked list:
In singly linked lists and doubly linked lists, the end of lists is indicated with a NULL value. But circular linked lists do not have ends. In circular linked lists, each node has a successor, and the last node points to the first node instead of NULL.

Example

Let x be a variable pointer and head.

Head is the pointer of the circular linked list.

Now to insert a new record (node) y, we have to loop through the linked list from the head to the last node like this pseudocode below.

x=head

while(x->next!=head)

{

   x=x->next;

}

After finishing the loop x is now the last node and we will append the list. y is the next node of x Then the next of y will have to point to the head since the linked list is circular. The pseudocode for this task is below.

x->next=y;

y->next=head; 

So There needs modification of two pointers

So the correct answer is Option 3

Latest UPSC IES Updates

Last updated on May 28, 2025

->  UPSC ESE admit card 2025 for the prelims exam has been released. 

-> The UPSC IES Prelims 2025 will be held on 8th June 2025.

-> The selection process includes a Prelims and a Mains Examination, followed by a Personality Test/Interview.

-> Candidates should attempt the UPSC IES mock tests to increase their efficiency. The UPSC IES previous year papers can be downloaded here.

More Linked List Questions

Get Free Access Now
Hot Links: teen patti master teen patti apk teen patti cash game teen patti real cash withdrawal