971 views

In circular singly linked list, insertion of node requires modification of how many pointers?

1. 1 pointers
2. 2 pointers
3. 3 pointers
4. 4 pointers
edited | 971 views
+2

it will require modification of 2 pointers viz. next of node N1 after which insertion is to be done and next of new node.

0
circular singly linked list or doubly.

In Singly: 2 pointers in middle, 1 in end

In Doubly: 4 pointers in middle , 2 in end

selected by
0
other than these pointers did we need to consider the modification in the head pointer also @thakur sir
+1

yes we consider for insertion at end of CSLL.

0
When I try to insert node at the beginning of CSLL, I have done the following steps:

We have made a new node pointed by p,

2) traverse till temp->next != head, then assign temp->next = p...(1st modification)

3) now assign p->next = head....(2nd modification).

4) assign head = p...(3rd modification)

How ans is 2 pointers...???
0

traverse till temp->next != NULL, then assign temp->next = p...(1st modification)

Please Explain this. And Where is Null is the Above Diagram ???

Last node will contain the address of the first  node ??

0
Thankyou for correcting....Edited

But how it is 2...??
0

Question is asking for the modification of the pointers.

As you are taking temp as the pointer. It is only for the traversing of the list.The actual modification will be in only two pointers.

0
when we insert at beginning, we are modifying last node's pointer, the node pointer which we have to insert and the head pointer....

I'm not counting temp pointer modification...!!
0
If we can draw the picture, please post that.
0

Please correct me if I'm wrong

0
Why  are you counting one for head = p ??
0
Here you are not doing to modification in the list. you are just shifting the head pointer.

If you will not do that then there is no problem because p will now work as the head pointer.
0
Because head pointer is also modified at the end...!!
0
What will be if we don't change the head pointer ???
0
The first two operations are the must. No need for third operation.

1
2
3
4
5
6