上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 33 下一页
摘要: Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: Input: 3 Output: [ [1,null,3,2], 阅读全文
posted @ 2020-01-08 11:36 xuan_abc 阅读(108) 评论(0) 推荐(0)
摘要: Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: Input: 3 Output: 5 Explanation: Given n = 3, the 阅读全文
posted @ 2020-01-07 12:41 xuan_abc 阅读(106) 评论(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 @ 2020-01-05 11:15 xuan_abc 阅读(91) 评论(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 @ 2020-01-05 10:45 xuan_abc 阅读(142) 评论(0) 推荐(0)
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2020-01-05 07:38 xuan_abc 阅读(169) 评论(0) 推荐(0)
摘要: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2 3 / / \ 4 5 阅读全文
posted @ 2020-01-05 06:31 xuan_abc 阅读(130) 评论(0) 推荐(0)
摘要: Given an n-ary tree, return the level order traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversa 阅读全文
posted @ 2020-01-04 12:56 xuan_abc 阅读(151) 评论(0) 推荐(0)
摘要: Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
posted @ 2020-01-04 12:40 xuan_abc 阅读(85) 评论(0) 推荐(0)
摘要: Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 阅读全文
posted @ 2020-01-04 12:21 xuan_abc 阅读(61) 评论(0) 推荐(0)
摘要: Given two strings s and t, determine if they are both one edit distance apart. Note: There are 3 possiblities to satisify one edit distance apart: Ins 阅读全文
posted @ 2020-01-03 12:39 xuan_abc 阅读(150) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 33 下一页