Skip to content

Conversation

@shengjiex98
Copy link

@shengjiex98 shengjiex98 commented Nov 5, 2025

除了之前count[next_node] += 1的缩进错误,因为链表的线性读取特性,if not in_queue[next_node]的判断每次需要 O(n) 时间复杂度。这里应该用其他解法中提过的in_queue数组/列表做判断 (O(1))。
基于 youngyangyang04#2964

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant