题目:https://leetcode.com/problems/odd-even-linked-list/
代码(github):https://github.com/illuz/leetcode
把一个链表的奇数位置上的节点拉到前面,偶数位置上的放到后面。
考察链表操作。
- 最简单的方法是构造两个链,再连起来就行了。
- 构造链时可以一对一对构造。
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
题目:https://leetcode.com/problems/odd-even-linked-list/
代码(github):https://github.com/illuz/leetcode
把一个链表的奇数位置上的节点拉到前面,偶数位置上的放到后面。
考察链表操作。