首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏calmound

    Linked List Cycle

    问题:判断链表是否有环。 分析:利用快慢指针slow,fast          slow指针每次走一步,fast指针每次走两步,倘若存在环,则slow和fast必定在某一时刻相遇。          由于fast指针走的比slow快所以循环的时候只需要判断fast和fast->next不为空,判断fast->next是因为防止出现fast->NULL->next这种情况 /** * Definition for singly-linked list. * struct ListNode { *

    57640发布于 2018-04-17
  • 来自专栏全栈程序员必看

    【leetcode】Linked List Cycle

    这个问题是见的非常多的题目,问题本身而言,技巧性非常强,或者说思路非常巧妙,这里要说的不是这个题目本身。而是说这样的技巧。在非常多的地方是用的到的,比方,在寻找单链表的中间节点的时候,就能够用这样的形式,一个走两步,一个走一步的形式,来获得中间节点。

    22720编辑于 2022-07-06
  • 来自专栏calmound

    ZOJ 3594 Sexagenary Cycle

    题意:天干地支。         天干: Jia, Yi, Bing, Ding, Wu, Ji, Geng, Xin, Ren and Gui         地支: Zi, Chou, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu and Hai         每一轮是60次,不要误认为120次。。。(常识),这道题是经典的水题,很水但是还是被坑了很久大概一下午加一晚上。。。。。搞不懂自己什么水平 说下这道题目的坑把,首先是输出地支的时候是小写。。。其次还有AD

    68850发布于 2018-04-11
  • 来自专栏给永远比拿愉快

    Leetcode: Linked List Cycle II

    题目: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. 思路分析: 和《Leetcode: Linked List Cycle 》一样还是双指针的方法。 ?

    54400发布于 2019-01-22
  • 来自专栏Reck Zhang

    LeetCode 0141 - Linked List Cycle

    Linked List Cycle Desicription Given a linked list, determine if it has a cycle in it.

    31940发布于 2021-08-11
  • 来自专栏算法修养

    LeetCode 141 Linked List Cycle

    方法很简单,遍历一遍即可,在遍历过的节点,都改变它的一个状态。如果形成环,会再次指向遍历过的节点,这个时候判断它的状态是否改变。

    43310发布于 2018-11-21
  • 来自专栏Lauren的FPGA

    Cycle-to-cycle jitter 和 Peak-to-peak jitter什么区别?

    相邻周期抖动 相邻周期抖动(Cycle-to-cycle jitter),顾名思义,指的是相邻的两个时钟周期之间的周期长度差异,如下图所示。

    3.4K31编辑于 2023-08-18
  • 来自专栏iSharkFly

    Linked List Cycle(带环链表)

    > * 102 *

    *

    https://www.cwiki.us/display/ITCLASSIFICATION/Linked+List+Cycle

    59730发布于 2019-01-30
  • 来自专栏计算机视觉与深度学习基础

    Leetcode 141 Linked List Cycle

    Given a linked list, determine if it has a cycle in it.

    63890发布于 2018-01-12
  • 来自专栏计算机视觉与深度学习基础

    Leetcode 142 Linked List Cycle II

    Given a linked list, return the node where the cycle begins. If there is no cycle, return null.

    76490发布于 2018-01-12
  • 来自专栏JNing的专栏

    Linked List Cycle

    Problem Given a linked list, determine if it has a cycle in it.

    45410发布于 2019-02-25
  • 来自专栏皮皮星球

    Linked List Cycle

    Linked List Cycle Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0 If pos is -1, then there is no cycle in the linked list. Example 1: Input: head = [3,2,0,-4], pos = 1 Output: true Explanation: There is a cycle in the linked

    49020发布于 2020-09-23
  • 来自专栏数据结构与算法

    HDU 5215 Cycle(dfs判环)

    \(T\)组数据,给出\(n\)个点\(m\)条边的有向图,问是否存在一个奇环/偶环

    65220发布于 2018-10-15
  • 来自专栏Bingo的深度学习杂货店

    Q141 Linked List Cycle

    Given a linked list, determine if it has a cycle in it.

    59280发布于 2018-04-25
  • 来自专栏算法修养

    LeetCode 142 Linked List Cycle II

    每遍历一个点,都要判断起点到这个点的距离,和启动点到这个点的next的距离。再比较一下就可以了。

    33110发布于 2018-11-21
  • 来自专栏后端技术

    Linked List Cycle II

    首先要证明链表有环: 用快慢两个指针解决。快指针每次走两步,慢指针每次走一步。如果有环,则一定会最终在环内某点相遇。下面证明这一点:

    39330发布于 2019-05-25
  • 来自专栏SnailTyan

    Linked List Cycle

    1. Description 2. Solution /** * Definition for singly-linked list. * struct ListNode { * int

    41020发布于 2019-05-25
  • 来自专栏Reck Zhang

    LeetCode 0142 - Linked List Cycle II

    Linked List Cycle II Desicription Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list.

    29010发布于 2021-08-11
  • 来自专栏刷题笔记

    Linked List Cycle

    Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0 If pos is -1, then there is no cycle in the linked list. Example 1: Input: head = [3,2,0,-4], pos = 1 Output: true Explanation: There is a cycle in the linked 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/linked-list-cycle 著作权归领扣网络所有。

    36120发布于 2020-06-23
  • 来自专栏高并发

    Linked List Cycle

    leetcode141题是判断链表是否有环,最常用的方法是用两个指针,一个快一个慢,快的是慢的速度的一倍,这样如果有环的话两个一定会相遇。这样最慢需要遍历2N遍就可以完成判断。自己还想了一种方法,这种方法坏处是需要破坏链表,但是需要N遍就可以AC.先写第一种方法

    21120编辑于 2022-06-23
领券