Given an unsorted array, find the maximum difference between the successive elements in its sorted form.
Try to solve it in linear time/space.
Return 0 if the array contains less than 2 elements. ...
分类:
其他好文 时间:
2015-02-05 09:38:18
阅读次数:
271
Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki...
分类:
其他好文 时间:
2015-02-04 23:17:55
阅读次数:
162
java.lang.OutOfMemoryError: PermGen space PermGen space 由-XX:PermSize -XX:MaxPermSize 引起java.lang.OutOfMemoryError: Java heap space Heap siz 由-Xms ...
分类:
编程语言 时间:
2015-02-04 23:04:54
阅读次数:
212
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 ...
分类:
其他好文 时间:
2015-02-04 18:03:07
阅读次数:
163
Explosion of the Ariane 5阿丽安娜5运载火箭爆炸之谜On June 4, 1996 an unmanned Ariane 5 rocket launched by the European Space Agency exploded just forty seconds after lift-off (918K QuickTime movie). The rocket wa...
分类:
其他好文 时间:
2015-02-04 16:41:38
阅读次数:
253
题目地址 :http://acm.timus.ru/problem.aspx?space=1&num=1277
这里我们要拆点。把一个点拆成i,i' 。如何 i,j有边 ,在建边(i,j',inf),(j,i',inf)。 然后每个点点边(i',i,R[i])。这样建边以后,若要阻止 s到f的路径,那么必须破败一些边,那么我们为了是的边权最小,必须破坏边权小于inf的边,对应的就是图中拆点后的边...
分类:
其他好文 时间:
2015-02-04 16:35:03
阅读次数:
195
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respectively in th...
分类:
编程语言 时间:
2015-02-04 09:28:40
阅读次数:
172
/* Connection tracking via netlink socket. Allows for user space * protocol helpers and general trouble making from userspace. * * (C) 2001 by Jay Sch...
分类:
Web程序 时间:
2015-02-04 07:05:23
阅读次数:
382
CSS2中常用的属性:text-indent:首行缩进;vertical-align:垂直对齐方式;white-space:空格处理方式;line-height:设置行高;CSS3新增文本属性:text-overflow:clip:溢出的部分裁切掉;ellipsis:显示省略标记(...) //该属...
分类:
Web程序 时间:
2015-02-03 14:51:56
阅读次数:
194
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:
其他好文 时间:
2015-02-03 14:37:44
阅读次数:
128