链表反转
2023-12-02 09:58:37 0 举报
链表反转
作者其他创作
大纲/内容
4
next = null
null
2. current.next = prev;
2. current.next = prev;
1
4. current = next;
指针
3
1. next = current.next;
next
2
3. prev = current;
current
prev
4. current = next;
按照红色虚线可以得到下面的结果
5
head
最终prev指向的就是新的链表表头
重新建立的链接
3. prev = current;
1. next = current.next;
prev = null
current = head
需要断开的链接
0 条评论
下一页