可以递归 ''' public ListNode ReverseList(ListNode head) { if (head == null) return null; if (head.next == null) return head; ListNode last = ReverseList(head.next); head.next.next = head; head.next = null; return last; } '''
点赞

相关推荐

不愿透露姓名的神秘牛友
昨天 10:56
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务