Write a C function to count number of nodes in a given singly linked list. For example, the function should return 5 for linked list… Read More »
We have already discussed 2 different ways to clone a linked list. In this post, one more simple method to clone a linked list is… Read More »
Given a linked list of co-ordinates where adjacent points either form a vertical line or a horizontal line. Delete points from the linked list which… Read More »
Given two sorted linked lists, construct a linked list that contains maximum sum path from start to end. The result list may contain nodes from… Read More »
Given a singly linked list, delete all occurrences of a given key in it. For example, consider the following list.
It doesn’t look possible to reverse a simple singly linked list. A simple singly linked list can only be reversed in O(n) time using recursive… Read More »
In general, array is considered a data structure for which size is fixed at the compile time and array memory is allocated either from Data… Read More »
We have discussed Linked List Introduction and Linked List Insertion in previous posts on singly linked list.
We have discussed Circular Linked List Introduction and Applications, in the previous post on Circular Linked List. In this post, traversal operation is discussed.
We have discussed singly and doubly linked lists in the following posts. Introduction to Linked List & Insertion
We strongly recommend to refer following post as a prerequisite of this post.
Given a linked list, reverse alternate nodes and append them to end of list. Extra allowed space is O(1)
In the previous post, we introduced Queue and discussed array implementation.
Output: Linked list before sorting 90 1 11 2 56 12 Linked list after sorting 1 2 11 12 56 90
Given a singly linked list, write a function to swap elements pairwise. For example, if the linked list is 1->2->3->4->5->6->7