上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页
摘要: Question You need to find the largest value in each row of a binary tree. Example: Solution 层次遍历。 Code 阅读全文
posted @ 2017-09-15 13:49 清水汪汪 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Question Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this singl 阅读全文
posted @ 2017-09-15 11:53 清水汪汪 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Question Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that a 阅读全文
posted @ 2017-09-15 10:14 清水汪汪 阅读(140) 评论(0) 推荐(0) 编辑
摘要: C++中的queue自身是不支持clear操作的,但是双端队列deque是支持clear操作的。 方法一 直接用空的队列对象赋值 方法二 遍历出队列 方法三 使用swap,这种是最高效的,定义clear,保持STL容器的标准。 阅读全文
posted @ 2017-09-15 09:40 清水汪汪 阅读(71338) 评论(0) 推荐(9) 编辑
摘要: Question Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: Output: 1 Example 2: Input: Output: 7 Note: You m 阅读全文
posted @ 2017-09-14 22:40 清水汪汪 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Question Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the 阅读全文
posted @ 2017-09-14 20:14 清水汪汪 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Question Given a non empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of element 阅读全文
posted @ 2017-09-13 19:30 清水汪汪 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Question Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your prog 阅读全文
posted @ 2017-09-13 16:08 清水汪汪 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Question Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t 阅读全文
posted @ 2017-09-13 14:24 清水汪汪 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Question Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 u 阅读全文
posted @ 2017-09-13 14:19 清水汪汪 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页