4 4 votes In circular singly linked list, insertion of node requires modification of how many pointers? 1 pointers 2 pointers 3 pointers 4 pointers Programming in C linked-list data-structures + – hacker16 24.4k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply joshi_nitish commented Nov 14, 2017 reply Follow flag it will require modification of 2 pointers viz. next of node N1 after which insertion is to be done and next of new node. 2 2 replyShare Anu007 commented Nov 14, 2017 reply Follow flag circular singly linked list or doubly. In Singly: 2 pointers in middle, 1 in end In Doubly: 4 pointers in middle , 2 in end 0 0 replyShare Aryan_Reddy commented Sep 30, 2024 reply Follow flag In circular singly linked list :- 3 in the beginning 2 in the middle and 2 in the end ??? 0 0 replyShare Please log in or register to add a comment.
Best answer 6 6 votes for circular singly linked list, Hira Thakur answered Nov 17, 2017 • selected Nov 17, 2017 by hacker16 Hira Thakur comment Share Follow See all 14 Comments 14 14 Comments reply hacker16 commented Nov 17, 2017 reply Follow flag other than these pointers did we need to consider the modification in the head pointer also @thakur sir 0 0 replyShare Hira Thakur commented Nov 17, 2017 reply Follow flag yes we consider for insertion at end of CSLL. see this: http://www.geeksforgeeks.org/circular-singly-linked-list-insertion/ 1 1 replyShare Anmol Verma commented Nov 17, 2018 i edited by Anmol Verma Nov 17, 2018 reply Follow flag 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, 1) assign head to temp 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 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag 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 0 replyShare Anmol Verma commented Nov 17, 2018 reply Follow flag Thankyou for correcting....Edited I read only Singly Linked List not circular.... But how it is 2...?? 0 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag 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 0 replyShare Anmol Verma commented Nov 17, 2018 reply Follow flag 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 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag If we can draw the picture, please post that. 0 0 replyShare Anmol Verma commented Nov 17, 2018 reply Follow flag Please correct me if I'm wrong 0 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag Why are you counting one for head = p ?? 0 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag 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 0 replyShare Anmol Verma commented Nov 17, 2018 reply Follow flag Because head pointer is also modified at the end...!! 0 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag What will be if we don't change the head pointer ??? 0 0 replyShare kumar.dilip commented Nov 17, 2018 reply Follow flag The first two operations are the must. No need for third operation. 0 0 replyShare Please log in or register to add a comment.