题目:(Sort)Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space....
分类:
其他好文 时间:
2014-12-30 01:45:54
阅读次数:
195
The questions:Determine whether an integer is a palindrome. Do this without extra space.Analysis:To determine whether an integer is a palindrome, we c...
分类:
其他好文 时间:
2014-12-30 01:41:54
阅读次数:
208
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?
首先设圆环的长度为r,距离环口为a时相遇,环外的那一段的距离是b,那么有2(a+b)=a...
分类:
其他好文 时间:
2014-12-29 21:35:30
阅读次数:
248
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
利用快慢指针
/**
* Definition for singly-linked list.
* class ListNode {
* int v...
分类:
其他好文 时间:
2014-12-29 21:35:23
阅读次数:
235
TT0802: Database permanent space exhausted...
分类:
其他好文 时间:
2014-12-29 16:50:13
阅读次数:
208
题目描述:
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 respectivel...
分类:
其他好文 时间:
2014-12-29 10:28:11
阅读次数:
183
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with...
分类:
其他好文 时间:
2014-12-28 14:16:37
阅读次数:
169
1.HTML不把“ ”当空格,因为HTML中经常有缩进,如果把缩进的空格在浏览器中以空格形式展现的话,排版会很麻烦。
2.如果要用空格,就用 (no-break space)。
3.为什么有特殊含义:标签的定义。
4.fd 表示粗体。
5. 此网站根目录下的这种图片。 这么写就不对了,表示的是当前目录下的这张图片。
"/"表示网站根目录,"../"表示父目录,,"...
分类:
Web程序 时间:
2014-12-27 23:16:38
阅读次数:
476
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word...
分类:
移动开发 时间:
2014-12-27 23:03:14
阅读次数:
176
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
题目的意思是判断链表中有没有环
思路:
定义两个指针,一个慢指针,一个快指针,慢指针一次走两步,快指针一次走一步,如果有环,那么慢、快指针一...
分类:
其他好文 时间:
2014-12-26 20:20:32
阅读次数:
191