摘要: 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) 编辑