题目描述:
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?
思路:
设置一个快指针fast,一个慢指针slow。快指...
分类:
其他好文 时间:
2014-11-11 16:41:06
阅读次数:
179
题目描述:
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
思路:初始化一个快指针fast,一个慢指针slow。快指针一次移动两个单位,慢指针一次移动一个单位。如果链表有环,则两指针必然会相遇。否则若fas...
分类:
其他好文 时间:
2014-11-11 16:40:35
阅读次数:
208
剑指offer中题目:http://ac.jobdu.com/problem.php?pid=1516
题目描述:
输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变。
输入:
每个输入文件包含一组测试案例。
对于每个测试案例,第一行输入...
分类:
编程语言 时间:
2014-11-11 12:45:52
阅读次数:
202
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space?怎样判断一个链表之中是否有环?可以利用快慢指针的方法。定义两个指针fast和slo...
分类:
其他好文 时间:
2014-11-10 23:15:29
阅读次数:
289
Header2ActionBar实现透明的actionbar,当listview滚动时,actionbar的透明度会随之改变。 项目主页:https://github.com/AChep/Header2ActionBar...
分类:
移动开发 时间:
2014-11-10 22:00:54
阅读次数:
507
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
思路1:打表
public class Solution {
public int totalNQ...
分类:
其他好文 时间:
2014-11-10 19:58:54
阅读次数:
220
CREATE PROCEDURE `up_truncate_all_table`()BEGIN DECLARE done INT DEFAULT 0; DECLARE tname CHAR(50); DECLARE cur1 CURSOR FOR SELECT table_name from ...
分类:
数据库 时间:
2014-11-10 19:31:05
阅读次数:
260
按钮广告(Button) 文件大小:gif:6K/swf:8K 广告尺寸:170*60/120*60像素 广告位置:第一屏?第二屏 备注:触发式LOGO,弹出图片尺寸为160*160?文件大小gif:9K/swf:12K 弹出窗口广告(Pop?up) 文件大小:gif...
分类:
Web程序 时间:
2014-11-10 18:16:12
阅读次数:
233
Web 站点提速的最佳实践(Best Practices for Speeding Up Your Web Site)...
分类:
Web程序 时间:
2014-11-10 15:38:09
阅读次数:
350
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-11-09 23:41:43
阅读次数:
201