题目:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must n....
分类:
编程语言 时间:
2014-07-31 05:22:45
阅读次数:
286
题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(Binary Search ....
分类:
编程语言 时间:
2014-07-31 05:21:55
阅读次数:
215
本文分别介绍了两种常用的添加ECB菜单项的方式。声明式创建这也是微软最佳实践推荐的方式。在VS中创建一个SharePoint空解决方案,并添加一个“空元素”类型的SPI。在Elements.xml中,定义一个CustomAction,重点关注一下其中高亮部分的属性(本例在文档内容类型的项上添加了一个...
分类:
其他好文 时间:
2014-07-31 02:29:15
阅读次数:
314
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2], The longes...
分类:
其他好文 时间:
2014-07-31 02:19:45
阅读次数:
243
Description
The Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements f0 and f1 which are respect...
分类:
其他好文 时间:
2014-07-31 00:08:05
阅读次数:
281
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight...
分类:
其他好文 时间:
2014-07-30 17:46:04
阅读次数:
244
Description
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seq...
分类:
其他好文 时间:
2014-07-30 12:22:33
阅读次数:
290
Convert Sorted List to Binary Search TreeTotal Accepted:12283Total Submissions:45910My SubmissionsGiven a singly linked list where elements are sorted...
分类:
其他好文 时间:
2014-07-29 17:29:32
阅读次数:
216
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题意:给定一个有序的链表,将其转换成平衡二叉搜索树思路: 二分法要构建一个平衡二叉...
分类:
其他好文 时间:
2014-07-29 13:40:48
阅读次数:
601
Gem StonesJohn has discovered various rocks. Each rock is composed of various elements, and each element is represented by a lowercase latin letter fr...
分类:
其他好文 时间:
2014-07-29 13:38:28
阅读次数:
208