update
This commit is contained in:
parent
dc5d8f0dfd
commit
f588b88700
@ -13,6 +13,7 @@ func Reverse(root *ListNode) *ListNode {
|
|||||||
return pre
|
return pre
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 递归反转链表 */
|
||||||
func ReverseRec(root *ListNode) *ListNode {
|
func ReverseRec(root *ListNode) *ListNode {
|
||||||
if root == nil || root.Next == nil {
|
if root == nil || root.Next == nil {
|
||||||
return root
|
return root
|
||||||
|
Loading…
Reference in New Issue
Block a user