上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.The lowest common ancestor is the node with large 阅读全文
posted @ 2017-02-03 06:18 璨璨要好好学习 阅读(297) 评论(0) 推荐(0) 编辑
摘要: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
posted @ 2017-02-03 04:12 璨璨要好好学习 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any 阅读全文
posted @ 2017-01-30 05:39 璨璨要好好学习 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: ["1->2->5" 阅读全文
posted @ 2017-01-29 12:14 璨璨要好好学习 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ 3 \ 4 阅读全文
posted @ 2017-01-29 09:18 璨璨要好好学习 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2017-01-29 06:13 璨璨要好好学习 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2017-01-27 12:27 璨璨要好好学习 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. 小小的一道题竟然做了半天。。。= = 乘法啊加法啊reverse这些一定要考虑到越界的问题。 另外可以使用start + 1 < end的条件,这个时候一般跳出循环 阅读全文
posted @ 2017-01-27 05:58 璨璨要好好学习 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n 阅读全文
posted @ 2017-01-27 04:26 璨璨要好好学习 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: [ ["ate", "eat","tea"], [" 阅读全文
posted @ 2017-01-27 03:07 璨璨要好好学习 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页