0

In Circular Linked List insertion of a node involves the modification of 2 links.

Explain why?

17th Sep 2019, 8:15 PM
Sourav Ghosh
Sourav Ghosh - avatar
3 Respostas
+ 1
In a circle of nodes each node is connected to the node in front of it, and the node behind it. One can see then that inserting a node will change these two links so the node behind it now points to the inserted node, and the inserted node points to the node that the one behind it used to point to. This may be difficult to follow if English is not your first language, so ask questions if you are still confused.
17th Sep 2019, 8:45 PM
Zeke Williams
Zeke Williams - avatar
0
when you insert a node into an doubly linkedlist, you need to change the pointers inside the node before and after the place you want to insert your new node into. the new node will have to point to the node before and after it and they in turn will have to point to it. in a singly LinkedList you would only have to change the pointer of one of the nodes (depending in which direction the circle is going) and the pointer inside the new node.
17th Sep 2019, 8:49 PM
Anton Böhler
Anton Böhler - avatar
0
Still confused
18th Sep 2019, 4:35 AM
Sourav Ghosh
Sourav Ghosh - avatar