We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何实现一个高效的单向链表逆序输出? 顺序进栈,再依次弹出
The text was updated successfully, but these errors were encountered:
https://leetcode-cn.com/problems/reverse-linked-list/
func reverseList(head *ListNode) *ListNode { if head == nil { return head } previous := head current := head.Next head.Next = nil for current != nil { p := current.Next current.Next = previous previous = current current = p } return previous }
Sorry, something went wrong.
No branches or pull requests
如何实现一个高效的单向链表逆序输出?
顺序进栈,再依次弹出
The text was updated successfully, but these errors were encountered: