今際の国の呵呵君
Friday, December 28, 2018
[LeetCode]Middle of the Linked List
双指针的问题,两个指针一快一慢,快的每次移动2的距离,慢的移动1的距离即可。时间复杂度O(N),常数空间。代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment