This commit is contained in:
ehlxr 2022-05-23 16:48:35 +08:00
parent dc5d8f0dfd
commit f588b88700

View File

@ -13,6 +13,7 @@ func Reverse(root *ListNode) *ListNode {
return pre
}
/* 递归反转链表 */
func ReverseRec(root *ListNode) *ListNode {
if root == nil || root.Next == nil {
return root