3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by firstPerson
Featured Replies
  • [B]> if it contains a loop, i.e is a circular linked list[/B] Not exactly. The loop not necessarily includes the head (consider 1->2->3->2). In that case your algorithm will run forever. The solution takes two pointers traversing the list with different "speeds": [CODE]pointer1 <- head pointer2 <- head do: pointer1 … Read More

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.