摘要: Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not... 阅读全文
posted @ 2014-04-02 15:55 SunshineAtNoon 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题:开始进入一个误区,跟循环链表搞混了,其实这个环的开头可以不在head这里,例如... 阅读全文
posted @ 2014-04-02 10:37 SunshineAtNoon 阅读(208) 评论(0) 推荐(0) 编辑