TPS interview question

How can you identify a loop in singly linked list?

Interview Answer

Anonymous

24 Apr 2017

Drop a Boolean(true) in every node if the next node's Boolean is already true than you have a loop