Given a circular singly linked list containing N nodes, the task is to delete all the even nodes from the list.
Input : 57->11->2->56->12->61 Output : List after deletion : 57 -> 11 -> 61 Input : 9->11->32->6->13->20 Output : List after deletion : 9 -> 11 -> 13
The idea is to traverse the nodes of the circular singly linked list one by one and get the pointer of the nodes having even data. Delete those nodes by following the approach used in this post.
Below is the implementation of the above idea:
List after deletion : 57 11 61
Time Complexity: O(N), where N is the total number of nodes.
- Delete all odd or even positioned nodes from Circular Linked List
- Delete all Prime Nodes from a Circular Singly Linked List
- Delete every Kth node from circular linked list
- Delete N nodes after M nodes of a linked list
- Sum of the nodes of a Circular Linked List
- Delete alternate nodes of a Linked List
- Delete all the even nodes from a Doubly Linked List
- Exchange first and last nodes in Circular Linked List
- Count nodes in Circular linked list
- Delete all nodes from the doubly linked list which are divisible by K
- Delete all Prime Nodes from a Doubly Linked List
- Delete all Non-Prime Nodes from a Singly Linked List
- Delete all the nodes from the doubly linked list that are greater than a given value
- Delete all the nodes from a doubly linked list that are smaller than a given value
- Delete all Prime Nodes from a Singly Linked List
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.