Happiness is more than pleasure without pain

你只有非常努力,才能看起来毫不费力

导航

2015年3月26日 #

Linked List Cycle II

摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?/**... 阅读全文

posted @ 2015-03-26 23:17 believer 阅读(151) 评论(0) 推荐(0) 编辑

Linked List Cycle

摘要: //快慢指针public class Solution {public boolean hasCycle(ListNode head) {if(head==null)return false;ListNode slow=head;ListNode fast=head;do{if(fast==null... 阅读全文

posted @ 2015-03-26 22:34 believer 阅读(96) 评论(0) 推荐(0) 编辑

剑指offer总结

摘要: 1、实现Singleton模式2、二维数组中的查找:每行从左到右递增,每列从上到下递增,输入一个数,判断数组中是否存在该数1 2 8 92 4 9 124 7 10 136 8 11 15如输入7:小于第4列的9,则不可能在第4列;column--小于第3列的8,则不可能在第3列;column--大... 阅读全文

posted @ 2015-03-26 15:06 believer 阅读(215) 评论(0) 推荐(0) 编辑