上一页 1 2 3 4 5 6 7 ··· 13 下一页
摘要: Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction 阅读全文
posted @ 2019-05-21 19:42 GoodRnne 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: The flattened tree should look like: 阅读全文
posted @ 2019-05-20 11:31 GoodRnne 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, count the number of distinct subsequences of S which equals T。A subsequence of a string is a new string which is form 阅读全文
posted @ 2019-05-19 18:56 GoodRnne 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 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 given sum. N 阅读全文
posted @ 2019-05-16 21:06 GoodRnne 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is de 阅读全文
posted @ 2019-05-15 20:07 GoodRnne 阅读(519) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le 阅读全文
posted @ 2019-05-15 19:50 GoodRnne 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 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 which the dep 阅读全文
posted @ 2019-05-14 19:49 GoodRnne 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2019-05-13 19:58 GoodRnne 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2019-05-13 12:01 GoodRnne 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2019-05-12 15:56 GoodRnne 阅读(181) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 13 下一页