上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 76 下一页
摘要: You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin 阅读全文
posted @ 2019-03-11 11:40 Schwifty 阅读(217) 评论(0) 推荐(0)
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, w 阅读全文
posted @ 2019-03-10 13:22 Schwifty 阅读(105) 评论(0) 推荐(0)
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2019-03-10 12:37 Schwifty 阅读(218) 评论(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 d 阅读全文
posted @ 2019-03-10 12:02 Schwifty 阅读(129) 评论(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 l 阅读全文
posted @ 2019-03-10 05:09 Schwifty 阅读(129) 评论(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-03-10 04:34 Schwifty 阅读(172) 评论(0) 推荐(0)
摘要: 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 the farthest l 阅读全文
posted @ 2019-03-10 04:27 Schwifty 阅读(120) 评论(0) 推荐(0)
摘要: Input: 5 Output: [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]杨辉(帕斯卡)三角思想是每一行先create一个全是1的数组,然后填充看似不难,实际上都是细节,比如defensively copying,asList方法的使用,上一行的 阅读全文
posted @ 2019-03-08 13:12 Schwifty 阅读(112) 评论(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-03-08 11:12 Schwifty 阅读(140) 评论(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 @ 2019-03-08 01:33 Schwifty 阅读(103) 评论(0) 推荐(0)
上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 76 下一页