Skip to content

关于中点问题 #25

Description

@voidbytes

https://github.com/greyireland/algorithm-pattern/blob/master/data_structure/linked_list.md
里面说"fast 如果初始化为 head.Next 则中点在 slow.Next

如果链表长度是偶数,返回中间偏右的位置
且fast如果初始化为head->next 返回中间偏左的位置。

但是对于奇数长度两者中点相同吧

  1. 链表的中间结点:https://leetcode-cn.com/problems/middle-of-the-linked-list/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions