How to check whether linked list is circular?

Questions by noor.lalu

Showing Answers 1 - 1 of 1 Answers

mahesh

  • Jun 17th, 2013
 

get two pointer to head of the list. then increment one pointer by two nodes and other by one node. if list is circular at some point both pointers will be pointing to same node. else u will encounter end of the list

Also if list is not circular when end of list is encountered one pointer will be pointing to middle of the list

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions