greyireland / greyireland/algorithm-pattern

关于中点问题

Open
#25 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.5k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

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

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

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

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.