How would you find out if a linked list contains a loop?
Anonymous
Have two iterators of the list, one moving two nodes each time, the other one node at a time. If they two instances are the same at any point, there is a loop.
Check out your Company Bowl for anonymous work chats.