Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?注意,链表循环并不是尾指针和头指针相同,可能是在中间某一段形成一个环路,所以不能只判...
分类:
其他好文 时间:
2014-10-21 22:56:24
阅读次数:
335
题目链接
Problem A: The Monocycle
A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel...
分类:
其他好文 时间:
2014-10-20 23:20:06
阅读次数:
309
Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.比I麻烦点的就是找到循环开始点TATI只是判断是否循环。要求不使用额外空...
分类:
其他好文 时间:
2014-10-20 11:40:37
阅读次数:
134
Linked List CycleGiven a linked list, determine if it has a cycle in it.c++/** * Definition for singly-linked list. * struct ListNode { * int val;...
分类:
其他好文 时间:
2014-10-19 23:04:39
阅读次数:
206
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Solution:快慢指针。 1 /** 2 * Definition for s....
分类:
其他好文 时间:
2014-10-17 15:16:48
阅读次数:
179
题目描述: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 spac...
分类:
其他好文 时间:
2014-10-15 11:10:10
阅读次数:
219
题目描述:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题方案:使用快慢指针,如果有环,快指针肯定会追上慢指针。下面是该题的代码...
分类:
其他好文 时间:
2014-10-15 00:03:19
阅读次数:
183
以形如 _fontValueChangedBlock = ^(){ [self.fontSmallButton addTarget:self action:@selector(btnFontSmallClicked) forControlEvents:UIContr...
分类:
其他好文 时间:
2014-10-13 16:12:29
阅读次数:
170
http://acm.hdu.edu.cn/showproblem.php?pid=1700题目大意: 二维平面,一个圆的圆心在原点上。给定圆上的一点A,求另外两点B,C,B、C在圆上,并且三角形ABC的周长是最长的。解题思路: 我记得小学的时候给出个一个定理,在园里面正多边形的的周长是最长的,.....
分类:
其他好文 时间:
2014-10-12 16:55:08
阅读次数:
245