上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the ... 阅读全文
posted @ 2015-08-13 20:56 尾巴草 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o... 阅读全文
posted @ 2015-08-13 20:30 尾巴草 阅读(141) 评论(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 depth... 阅读全文
posted @ 2015-08-13 10:23 尾巴草 阅读(131) 评论(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 @ 2015-08-13 09:43 尾巴草 阅读(141) 评论(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 @ 2015-08-12 16:13 尾巴草 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,... 阅读全文
posted @ 2015-08-12 11:37 尾巴草 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3,2]... 阅读全文
posted @ 2015-08-12 11:32 尾巴草 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3... 阅读全文
posted @ 2015-08-12 11:12 尾巴草 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o... 阅读全文
posted @ 2015-08-12 10:48 尾巴草 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as sh... 阅读全文
posted @ 2015-08-11 20:26 尾巴草 阅读(100) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页