January 31, 2009

Loops in Linked List

Problems with linked lists occur mainly while building or using a bad memory manager. Let us discuss two well known linked list problems.

Problem: Find if two linked lists short at some node. Find the node at which the two lists short.

Solution: show

Problem: A linked list might contain a loop. How do we detect existence of the loop and find the node from which loop starts. Propose an O(n) time algorithm that doesn't take extra space and doesn't modify the linked list.

Solution: show

1 comment:

  1. I bloǥ freԛuently and I seriously thank yoս
    for your content. Youг article hass really peaked my interest.
    I am going to take a notе of your website anԀ keеp checking for new information about once
    pper wеek. I opted in for your Feed as well.

    Here is my wеbsite :: writing service essay

    ReplyDelete