Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Analysis: typical Runner Technique. 一次过 1 ...
分类:
其他好文 时间:
2014-06-28 13:44:51
阅读次数:
164
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?一次...
分类:
其他好文 时间:
2014-06-28 13:38:14
阅读次数:
171
题目:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?个人思路:1、判断一个链表是否有环,标准做法...
分类:
其他好文 时间:
2014-06-27 19:41:40
阅读次数:
165
Determine whether an integer is a palindrome. Do this without extra space.
分类:
其他好文 时间:
2014-06-27 12:28:06
阅读次数:
228
1.基于消息的通信机制 Intent ---bundle ,extra数据类型有限,比如遇到不可序列化的数据Bitmap,InputStream,或者LinkedList链表等等数据类型就不太好用。2.利用static静态数据,public static成员变量;3.基于外部存储的传输,File/P...
分类:
移动开发 时间:
2014-06-26 17:05:25
阅读次数:
273
【题目】
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
【题意】
给定一个整数数组,其中除了一个数以外,其他数都是成对出现的,...
分类:
其他好文 时间:
2014-06-26 10:13:27
阅读次数:
254
http://bbs.osgchina.org/viewthread.php?tid=342&extra=page%3D3虽说自己原创的部分并不算多,不过总算是调试通过了,中间有多次严重的死机……估计该换新显卡了~~不过最后的效果还蛮不错? 实现海洋平面的GLSL源代码来自:http://emiug...
分类:
其他好文 时间:
2014-06-25 13:46:34
阅读次数:
705
Given an index k, return the
kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only
O(k) extra space?
...
分类:
其他好文 时间:
2014-06-22 21:31:26
阅读次数:
214
Determine whether an integer is a palindrome. Do this without extra space.
思路:若使用【Leetcode】Reverse
Integer 的方法,判断反转后的整数是否与原整数相同,则可能出现溢出情况;又因为题目要求不适用额外空间,可以之间对比整数第一个与最后一个数的值,再依次类推。
class Solution {...
分类:
其他好文 时间:
2014-06-22 20:43:56
阅读次数:
187
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Linked List Cycle IIGiven...
分类:
其他好文 时间:
2014-06-20 20:46:58
阅读次数:
245