Reverse a singly linked list.
This question is very basic and requires thorough mastery.
/** * Definition for singly-linked list. * public class ListNode { * int val; head.next; } return pre; } } This siteOriginal articleAll follow "Attribution-NonCommercial-ShareAlike 4.0 License (CC BY-NC-SA 4.0)Please retain the following annotations when sharing or adapting:
Original author:Jake Tao,source:"LeetCode – 206. Reverse Linked List"