题目
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
方法
和有序数组的思想基本一样,将链表进行二分。
TreeNode getBST(ListNode head, int len) {
i...
分类:
其他好文 时间:
2014-06-20 09:46:33
阅读次数:
267
[root@rusky ~]# free -m total used free shared
buffers cachedMem: 1011 343 667 0 34 218-/+ buffers/cache: 91 919Swap: 1992 0
1992[root@rusky ~...
分类:
系统相关 时间:
2014-06-06 22:22:56
阅读次数:
399
查看sqlserver被锁的表以及如何解锁查看被锁表:select
request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks where resourc...
分类:
数据库 时间:
2014-06-06 20:57:54
阅读次数:
274
Matrix的数学原理平移变换旋转变换缩放变换错切变换对称变换代码验证Matrix的数学原理在Android中,如果你用Matrix进行过图像处理,那么一定知道Matrix这个类。Android中的Matrix是一个3
x 3的矩阵,其内容如下:Matrix的对图像的处理可分为四类基本变换:Tran...
分类:
移动开发 时间:
2014-06-03 16:15:27
阅读次数:
560
【题目】
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 forward. Could you devise a constant space solution?
confused what "{1,#,2,3}" ...
分类:
其他好文 时间:
2014-06-02 10:38:17
阅读次数:
246
Subsets
Total Accepted: 13267 Total
Submissions: 48509My Submissions
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-desc...
分类:
其他好文 时间:
2014-06-02 10:28:35
阅读次数:
186
执行srvctl是报错
errorwhileloadingsharedlibraries:libpthread.so.0:
[oracle@rac02~]$srvctl
/opt/ora10g/product/10.2.0/db_1/jdk/jre/bin/java:errorwhileloadingsharedlibraries:libpthread.so.0:
cannotopensharedobjectfile:Nosuchfileordirectory
查看srvctl命令..
分类:
其他好文 时间:
2014-06-02 04:09:00
阅读次数:
285
3-sum
题目描述:
Given an array S of n integers,
are there elements a, b, c in S such
that a + b + c =
0? Find all unique triplets in the array which gives the sum of zero.
题目要求:
Elements...
分类:
其他好文 时间:
2014-06-01 17:31:27
阅读次数:
471
Remove ElementGiven an array and a value,
remove all instances of that value in place and return the new length.The order
of elements can be changed. ...
分类:
其他好文 时间:
2014-06-01 12:29:11
阅读次数:
190
自定义了CSS的样式,希望在页面中起作用。因为MVC中Views/Shared/_Layout.cshtml是所有试图的公共文件,如下:
@ViewBag.Title @RenderBody()通过这句话使用了一个外部层叠样式表文件,位置在"~/Content/Site....
分类:
Web程序 时间:
2014-06-01 12:13:36
阅读次数:
274