(ListNode head)
| 1 | class Solution { |
| 2 | public ListNode reverseList(ListNode head) { |
| 3 | ListNode cur=head; |
| 4 | ListNode prev = null; |
| 5 | while(cur!=null) |
| 6 | { |
| 7 | ListNode newNext = cur.next; |
| 8 | cur.next = prev; |
| 9 | prev=cur; |
| 10 | cur=newNext; |
| 11 | } |
| 12 | head = prev; |
| 13 | return head; |
| 14 | } |
| 15 | } |
nothing calls this directly
no outgoing calls
no test coverage detected