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
Given two linked lists, insert nodes of second list into first list at alternate positions of first list.
QuickSort on Doubly Linked List is discussed here. QuickSort on Singly linked list was given as an exercise. Following is C++ implementation for same.
Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes,… Read More »
Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be… Read More »
Following is a typical recursive implementation of QuickSort for arrays. The implementation uses last element as pivot.
We have introduced Linked Lists in the previous post. We also created a simple linked list with 3 nodes and discussed linked list traversal.
Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at contiguous location; the elements are linked using… Read More »
Given a linked list where in addition to the next pointer, each node has a child pointer, which may or may not point to a… Read More »