Skip to content

Tag Archives: Tortoise-Hare-Approach

Given A sorted linked list of elements. The task is to find the median in the given Sorted Linked List.We know that median in a sorted… Read More
Given a singly linked list, find middle of the linked list and set middle node of the linked list at beginning of the linked list. Examples:  … Read More
Given a linked list containing n nodes. The problem is to insert a new node with data x at the middle of the list. If… Read More
Given a singly linked list, delete the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the linked list… Read More
Write a function detectAndRemoveLoop() that checks whether a given Linked List contains loop and if loop is present then removes the loop and returns true.… Read More
  Given a linked list, check if the linked list has loop or not. Below diagram shows a linked list with a loop.     Recommended:… Read More