(Java) LeetCode 206. Reverse Linked List —— 反转链表

Posted tengdai

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(Java) LeetCode 206. Reverse Linked List —— 反转链表相关的知识,希望对你有一定的参考价值。

Reverse a singly linked list.

Example:

Input: 1->2->3->4->5->NULL
Output: 5->4->3->2->1->NULL

Follow up:

A linked list can be reversed either iteratively or recursively. Could you implement both?

以上是关于(Java) LeetCode 206. Reverse Linked List —— 反转链表的主要内容,如果未能解决你的问题,请参考以下文章