MCPcopy Create free account
hub / github.com/Blankj/awesome-java-leetcode / reverse

Method reverse

src/com/blankj/hard/_0025/Solution.java:29–39  ·  view source on GitHub ↗
(ListNode pre, ListNode next)

Source from the content-addressed store, hash-verified

27 }
28
29 private ListNode reverse(ListNode pre, ListNode next) {
30 ListNode head = pre.next;
31 ListNode move = head.next;
32 while (move != next) {
33 head.next = move.next;
34 move.next = pre.next;
35 pre.next = move;
36 move = head.next;
37 }
38 return head;
39 }
40
41 public static void main(String[] args) {
42 Solution solution = new Solution();

Callers 1

reverseKGroupMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected