链表反转,我的代码测试通过了,但是提交的时候不行,是什么原因
public class Solution { public ListNode ReverseList(ListNode head) { if(head.next == null){ return head; } ListNode cur = head; ListNode prev = null;//辅助指针 ListNode next = cur.next; while(cur!=null){ cur.next = prev; prev = cur; cur = next; if(cur !=null){ next = cur.next;// } } return prev; } }
显示有4个测试用例,只通过了3个,想知道通不过的那个测试用例是什么样的?