Time to flex your coding muscle. This week's question is about linked lists
U Suck At Coding
Time to flex your coding muscle. This week's question is about linked lists:

Given a standard linked list implementation, write an algorithm to detect a cycle in a list. A cycle is an infinite loop in the list. For example, if the list's last node points back to the list's second node, it contains a cycle. The solution should be a function that accepts a pointer to the head of the list and returns true if the list contains a cycle, otherwise false.

The first person to reply to this email with the most correct solution will win infinite respect. Seriously.
 
Too hard? Too easy? Reply to this email and let us know. We'll do better next time.
Copyright © 2012 usuckatcoding.com, All rights reserved.
Email Marketing Powered by Mailchimp