Category: Linked List


Merge Two Sorted Linked Lists in Javascript

Problem : Given list l1 = 1->2->3. And list l2 = 10->20->30. Generate a new list mergedList = 1->2->3->10->20->30. Given list l1 = 1->3->4. And list l2 = 1->2->3. Generate a new list mergedList...


Detect start of a loop in linked list

Problem : Given a linked list, implement an algorithm which returns the node at the beginning of the loop. This post is a follow-up of – JavaScript Linked List Example – Detect a loop...


Reverse a singly linked list

Problem description : Write a function to reverse a singly linked list. Input : A linked list Output : A linked list Logic : Iterate through linked list with three-pointers previous, current, next. While...