[html] view
plaincopyprint?
span style="white-space:pre">span>span style="white-space:pre"> span>c:if test="${sessionScope.errorcode!=null}">
span style="wh...
分类:
Web程序 时间:
2014-11-27 10:42:42
阅读次数:
268
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2014-11-27 06:44:59
阅读次数:
215
Sort a linked list in O(n log n) time using constant space complexity.Analsys:We use Merge Sort.NOTE: We should practice other sort algorithm, linke Q...
分类:
其他好文 时间:
2014-11-27 01:35:39
阅读次数:
213
Clarification:What constitutes a word?A sequence of non-space characters constitutes a word.Could the input string contain leading or trailing spaces?...
分类:
其他好文 时间:
2014-11-26 20:37:05
阅读次数:
142
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
这个题目如果没有空间复杂度O(1)的限制,我可以想到的方法就是:遍历整个list,将每个节点的地址存入一个vector,如果发现某个节点的next的地址已经在vec...
分类:
其他好文 时间:
2014-11-26 19:02:15
阅读次数:
119
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
这个题目跟Linked List Cycle一样,我也没有能够自己独立找到解决方法,...
分类:
其他好文 时间:
2014-11-26 18:57:10
阅读次数:
126
ural 2029 Towers of Hanoi Strike Back链接:http://acm.timus.ru/problem.aspx?space=1&num=2029题意:汉诺塔问题,给定一串只有(A, B, C)的字符串(A代表在第一根柱子,B代表在第二根柱子,C代表在第三根柱子),从...
分类:
其他好文 时间:
2014-11-26 18:36:17
阅读次数:
214
ural 2032 Conspiracy Theory and Rebranding链接:http://acm.timus.ru/problem.aspx?space=1&num=2032题意:给定一个三角形的三条边 (a, b, c),问是否可放在二维坐标,使得3个顶点都是整数点。若可以,输出任意...
分类:
其他好文 时间:
2014-11-26 18:03:17
阅读次数:
158
Sort a linked list in O(n log n) time using constant space complexity....
分类:
编程语言 时间:
2014-11-26 16:37:32
阅读次数:
172
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from ...
分类:
其他好文 时间:
2014-11-26 16:29:34
阅读次数:
164