排序:
默认
按更新时间
按访问量

leetcode第51题(validate-binary-search-tree)

题目: Given a binary tree, determine if it is a valid binary search tree (BST).  Assume a BST is defined as follows:  The left subtree of ...

2018-02-09 21:01:49

阅读数:34

评论数:0

leetcode第50题(recover-binary-search-tree)

题目: Two elements of a binary search tree (BST) are swapped by mistake.  Recover the tree without changing its structure.  Note:  A solution u...

2018-02-09 20:46:59

阅读数:32

评论数:0

leetcode第49题(same-tree)

题目: 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...

2018-02-09 16:41:17

阅读数:26

评论数:0

leetcode第48题(symmetric-tree)

题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).  For example, this binary tree is symm...

2018-02-09 16:33:37

阅读数:25

评论数:0

leetcode第47题(binary-tree-level-order-traversal)

题目: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).  For example: ...

2018-02-09 16:15:00

阅读数:43

评论数:0

leetcode第46题(binary-tree-zigzag-level-order-traversal)

题目: Given a binary tree, return the zigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next l...

2018-02-09 16:00:15

阅读数:19

评论数:0

leetcode第45题(maximum-depth-of-binary-tree)

题目: Given a binary tree, find its maximum depth.  The maximum depth is the number of nodes along the longest path from the root node down to ...

2018-02-09 15:42:09

阅读数:41

评论数:0

leetcode第44题(construct-binary-tree-from-preorder-and-inorder-……)

题目: Given preorder and inorder traversal of a tree, construct the binary tree.  Note:  You may assume that duplicates do not exist in the tr...

2018-02-09 15:29:08

阅读数:31

评论数:0

leetcode第43题(binary-tree-level-order-traversal)

题目: Given inorder and postorder traversal of a tree, construct the binary tree.  Note:  You may assume that duplicates do not exist in t...

2018-02-09 14:15:13

阅读数:29

评论数:0

leetcode第42题(binary-tree-level-order-traversal-ii)

题目: Given a binary tree, return the bottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to ro...

2018-02-09 14:11:37

阅读数:22

评论数:0

leetcode第41题(convert-sorted-array-to-binary-search-tree)

题目: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 思路: 跟上题的思路一样,但这题更简单,因为数组可以随便取到中间的值,不需要通过快慢...

2018-02-08 21:04:49

阅读数:34

评论数:0

leetcode第40题(convert-sorted-list-to-binary-search-tree)

题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 思路: 链接:https://www.nowcoder.net/qu...

2018-02-08 20:49:30

阅读数:67

评论数:0

leetcode第39题(balanced-binary-tree)

题目: Given a binary tree, determine if it is height-balanced.  For this problem, a height-balanced binary tree is defined as a binary tree in ...

2018-02-08 20:19:18

阅读数:30

评论数:0

leetcode第38题(path-sum)

题目: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give...

2018-02-08 19:46:23

阅读数:40

评论数:0

leetcode第37题(path-sum-ii)

题目: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.  For example: Given the below bin...

2018-02-08 19:44:13

阅读数:31

评论数:0

leetcode第36题(distinct-subsequences)

题目: Given a string S and a string T, count the number of distinct subsequences of T in S.  A subsequence of a string is a new string which is f...

2018-02-08 16:18:04

阅读数:28

评论数:0

leetcode第34.35题(populating-next-right-pointers-in-each-node)

题目: Follow up for problem "Populating Next Right Pointers in Each Node".  What if the given tree could be any binary tree? Would ...

2018-02-08 15:37:22

阅读数:39

评论数:0

leetcode第33题(pascals-triangle)

题目: Given numRows, generate the first numRows of Pascal's triangle.  For example, given numRows = 5, 思路:下一行数据是上一行两个相邻数相加。 代码: til....

2018-02-07 21:16:41

阅读数:36

评论数:0

leetcode第32题(pascals-triangle-ii)

题目: Given an index k, return the k th row of the Pascal's triangle.  For example, given k = 3, Return[1,3,3,1].  Note:  Could you optimi...

2018-02-07 21:13:40

阅读数:28

评论数:0

leetcode第31题(triangle)

题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.  For example, ...

2018-02-07 20:18:02

阅读数:25

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭