📜  递归反向链表 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:02.797000             🧑  作者: Mango

代码示例1
public ListNode reverseList(ListNode head) {
    if (head == null || head.next == null) return head;
    ListNode p = reverseList(head.next);
    head.next.next = head;
    head.next = null;
    return p;
}