输入一个链表反转链表后输出新链表的表头。public class Solution { public ListNode ReverseList(ListNode head) { ListNode prenull; ListNode nextnull; while(head!null){ nexthead.next; head.nextpre; prehead; headnext; } return pre; } }