Skip to content

Latest commit

 

History

History
15 lines (15 loc) · 396 Bytes

55.md

File metadata and controls

15 lines (15 loc) · 396 Bytes

Reverse Linked List

LeetCode Link

    public ListNode reverseList(ListNode head) {
        ListNode prev=null;
        ListNode curr=head;
        ListNode Next=null;
        while(curr!=null){
            Next=curr.next;
            curr.next=prev;
            prev=curr;
            curr=Next;
        }
        return prev;
    }