Delete N-th Node from End of a Linked List

In the previous article, we saw how to delete the N-th node of a linked list from the beginning of the list. Here we’ll see how to delete N-th node from the end. N starts with 0. Deleting 0-th node from end means deleting the last node. Logic to Delete the N-th Node from End … Continue reading “Delete N-th Node from End of a Linked List”

Delete N-th Node of a Linked List

Here we’ll see how to delete a node specified by its position (N-th node) from a linked list. N starts with 0. If N is 0, then delete the head node, if 1 then the second node and so on. Logic to Delete N-th Node from Linked List If head points to NULL, return. The … Continue reading “Delete N-th Node of a Linked List”

Circular Linked List in C

Circular linked list is like a regular linked list except its last node points to the first node. Generally the last node of linked list points to NULL. But the last node of circular linked list points back to the first node. If you traverse a regular linked list, you can not come back to … Continue reading “Circular Linked List in C”

C Program to Move the Last Node to the Front of a Linked List

Here we’ll see how to write C Program to move the last node to the front of a linked list. We can do that just by re-arranging the pointers. No need to create or delete any node. Logic to Move the Last Node to the Front If the linked list is empty or has only … Continue reading “C Program to Move the Last Node to the Front of a Linked List”

C Program to Delete the Last Node of a Linked List

Here we’ll see how to delete the last node of a linked list. The last node always points to NULL. To delete that, we have to traverse up to last node. We have to point the second last node to NULL and free memory of the last node. After deletion the second last node will … Continue reading “C Program to Delete the Last Node of a Linked List”

1
0
0
4
10
1