Fork me on GitHub
摘要: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 判断链表是否带环,我们可以采用在头结点设两个指针,一个叫fast,一个叫slo 阅读全文
posted @ 2017-02-25 20:19 hellowOOOrld 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2017-02-25 17:40 hellowOOOrld 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. Note: Re 阅读全文
posted @ 2017-02-25 16:42 hellowOOOrld 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Note: Recursive soluti 阅读全文
posted @ 2017-02-25 15:21 hellowOOOrld 阅读(140) 评论(0) 推荐(0) 编辑