Tagged: data structure

Find Length of Loop of the Linked List

“Find Length of Loop of the Linked List” problem is an extension of problem “Detect Loop in a Linked List”. In this problem, we need to detect whether loop exists in a linked list or not, and if loop exists, then we need to find length of loop of the...

Detect Loop in a Linked List

“Detect Loop in a Linked List” is one of the most important problem asked in various technical and algorithmic interviews. Here, we are given a linked list and our task is to detect whether there exists a  loop in a linked list.  For Example, following linked list have a loop of...

Count nodes in a linked list with given value

“Count nodes in a linked list with given value” is a basic programming problem based on linked list data structures for beginners. Here, we are given a linked list and our task is to count nodes in a linked list with given value. To do so, we need to traverse...

blank

Swap elements of adjacent nodes of the Linked List

“Swap elements of adjacent nodes of the Linked List” is one of the basic programming problem based on Linked List data structure. Here, we are given a linked list and our task is to swap elements of adjacent nodes of the linked list. Example: Suppose, we need to swap elements of...

blank

Reverse a Linked List Using Stack

“Reverse a Linked List Using Stack” is very popular programming problem based on linked list and stack data structures. Here, we are given a linked list and our task is to reverse a linked list using stack. Example: Suppose, we need to reverse the following linked list: LINKED LIST:       12...

blank

Reverse a Linked List

“Reverse a Linked List” is one of the favourite technical interview problem based on Linked List. Here, we are given a linked list and our task is to reverse the given list.  NOTE: We need to reverse the order of the nodes, not reverse the data value of nodes. The steps...

blank

Insert Node in the Sorted Linked List

“Insert Node in the Sorted Linked List” is one of the popular programming problem based on Linked List data structure. Here, we are given a sorted linked list and our task is to insert a node in a sorted linked list in such a way that after inserting the new...

blank

Insert Node at the End of Singly Linked List

“Insert Node at the End of Singly Linked List” is very basic programming problem based on. of linked list data structures. Here, we are given a linked list and our task. is to add a new node is added at the end of the linked list.  Example: Current Linked List: ...