reference占4个字节
Linked List 链表

  • 使用dummy node时,定义完dummy.next = head; 一定要将dummy赋给一个ref (head或叫做node)
  • reverse时要注意reverse和connect
  • reverse时用到两根指针
  • 判断cycle时,或判断intersection时用到HashSet更容易
    HashSet.add() 方法
  • 可以用while(head.next != null), 但不可以用while(node.next != null), (NullPointerException)

相关文章:

  • 2022-01-27
  • 2022-01-02
  • 2021-05-19
  • 2021-09-03
  • 2022-12-23
  • 2021-09-25
  • 2021-12-01
  • 2021-07-24
猜你喜欢
  • 2021-04-05
  • 2022-12-23
  • 2021-07-07
  • 2021-08-01
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案