[LeetCode]Reverse Linked List@python
Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?方法一:遍历链表,新建链表从头开始加入
def reverse_linkedlist(head):...
原创
2018-01-30 10:55:27 ·
167 阅读 ·
0 评论