摘要: 题目原文:Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.DEFINITIONCircular linked list: A (corrupt) linked list in which a node’s next pointer points to an earlier node, so as to make a loop in the linked list.EXAMPLEInput: A –> B –> C –> D 阅读全文
posted @ 2013-07-11 11:23 一枚程序员 阅读(427) 评论(0) 推荐(0)
摘要: 题目原文:You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1’s digit is at the head of the list. Write a function that adds the two numbers and returns the sum as a linked list.EXAMPLEInput: (3 –> 1 –> 阅读全文
posted @ 2013-07-11 11:18 一枚程序员 阅读(246) 评论(0) 推荐(0)