Skip to content
New issue

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

反转链表 | HZFE - 剑指前端 Offer #71

Open
utterances-bot opened this issue Nov 13, 2022 · 1 comment
Open

反转链表 | HZFE - 剑指前端 Offer #71

utterances-bot opened this issue Nov 13, 2022 · 1 comment

Comments

@utterances-bot
Copy link

反转链表 | HZFE - 剑指前端 Offer

题目描述

https://febook.hzfe.org/awesome-interview/book2/algorithm-reverse-linked-list

Copy link

迭代版可以缩减下

  while (cur) {
      [cur.next, pre, cur] = [pre, cur, cur.next];
  }
  return pre;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants