/* * function ListNode(x){ * this.val = x; * this.next = null; * } */ /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param head ListNode类 * @return ListNode类 */ let l1=null,l2; function ReverseList( head ) { // write code here while(head){ l2=head.next//记录下一个结点 head.next=l1//交换结点 l1=head//移动被指向结点...