3 votes 3 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 asked Nov 14, 2017 • edited Nov 14, 2017 by hacker16 hacker16 21.4k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply joshi_nitish commented Nov 14, 2017 reply Follow Share 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 votes 2 votes Anu007 commented Nov 14, 2017 reply Follow Share 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 votes 0 votes Please log in or register to add a comment.
Best answer 5 votes 5 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 See all 14 14 Comments reply hacker16 commented Nov 17, 2017 reply Follow Share other than these pointers did we need to consider the modification in the head pointer also @thakur sir 0 votes 0 votes Hira Thakur commented Nov 17, 2017 reply Follow Share yes we consider for insertion at end of CSLL. see this: http://www.geeksforgeeks.org/circular-singly-linked-list-insertion/ 1 votes 1 votes Anmol Verma commented Nov 17, 2018 i edited by Anmol Verma Nov 17, 2018 reply Follow Share 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 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share 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 votes 0 votes Anmol Verma commented Nov 17, 2018 reply Follow Share Thankyou for correcting....Edited I read only Singly Linked List not circular.... But how it is 2...?? 0 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share 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 votes 0 votes Anmol Verma commented Nov 17, 2018 reply Follow Share 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 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share If we can draw the picture, please post that. 0 votes 0 votes Anmol Verma commented Nov 17, 2018 reply Follow Share Please correct me if I'm wrong 0 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share Why are you counting one for head = p ?? 0 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share 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 votes 0 votes Anmol Verma commented Nov 17, 2018 reply Follow Share Because head pointer is also modified at the end...!! 0 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share What will be if we don't change the head pointer ??? 0 votes 0 votes kumar.dilip commented Nov 17, 2018 reply Follow Share The first two operations are the must. No need for third operation. 0 votes 0 votes Please log in or register to add a comment.