MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / reverseList

Function reverseList

tasks/206.go:8–18  ·  view source on GitHub ↗
(head *ListNode)

Source from the content-addressed store, hash-verified

6}
7
8func reverseList(head *ListNode) *ListNode {
9 current := head
10 var prev, next *ListNode
11 for current != nil {
12 next = current.Next
13 current.Next = prev
14 prev = current
15 current = next
16 }
17 return prev
18}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected