星巢文化

关注

【nc】 Linked List 3/6 reorder-list 重排链表 143

星巢文化

关注

阅读 43

2023-07-15

【nc】 Linked List 3/6 reorder-list 重排链表 143_数组

 

===

思路:

1 创建dummy和tail,指向head

2 创建tmp数组,将节点值推入

3 tmp数组从1开始slice

4 对这个数组,依次,pop,shift,重复这个过程,将结果连接到dummy中

【nc】 Linked List 3/6 reorder-list 重排链表 143_数组_02

 

 



相关推荐

小贴贴纸happy

【nc】 Linked List 1/6 Reverse Linked List 翻转链表 206

小贴贴纸happy 26 0 0

小禹说财

【nc】 Linked List 5/6 linked-list-cycle 环形链表 141

小禹说财 14 0 0

年迈的代码机器

143. Reorder List

年迈的代码机器 109 0 0

梅梅的时光

【LeetCode 143】重排链表

梅梅的时光 39 0 0

非凡兔

143. 重排链表

非凡兔 70 0 0

夏沐沐

02-链表结构(Linked list)

夏沐沐 223 0 0

small_Sun

C++实现链表(linked list)

small_Sun 50 0 0

ZSACH

LeetCode 142. Linked List Cycle II - 链表(Linked List)系列题17

ZSACH 90 0 0

南柯Taylor

【nc】 Linked List 4/6 remove-nth-node-from-end-of-list 删除链表的倒数第n个节点 19

南柯Taylor 8 0 0

三分梦_0bc3

【nc】 Linked List 2/6 merge-two-sorted-lists 合并两个有序链表 21

三分梦_0bc3 75 0 0

精彩评论(0)

0 0 举报