Reverse Linked List /** * Definition for singly-linked list. * public class ListNode { * public int val; * public ListNode next; * public ListNode(int x) { val = x; } * } */ public class Solution { public ListNode ReverseList(ListNode head) { ListNode pre = null, cur = null, next = null; cur =…
Read more