链表中倒数第k个节点
链表中倒数第k个节点
Description
Solution
Using fast-slow pointers, let fast pointer firstly walk k step then slow and fast walk togerther.
Code
1 | /** |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Using fast-slow pointers, let fast pointer firstly walk k step then slow and fast walk togerther.
1 | /** |