当前位置:网站首页>19. Delete the penultimate node of the linked list

19. Delete the penultimate node of the linked list

2022-07-05 01:12:00 qq_ forty-eight million two hundred and thirty thousand four hu

I'll give you a list , Delete the last of the linked list n Nodes , And return the head node of the list .

------------------------------------------------------------------------------------

Ideas : Set up pre The next node under the node points to the head node Because it is possible to delete the header node

Pioneer and backup nodes point to pre The reciprocal of the cycle condition is not 0 Pioneer moves backward

The back-up and the vanguard have distanced themselves, which is just the penultimate n individual

Move to the last The next pioneer is null Backing up next is equal to next

原网站

版权声明
本文为[qq_ forty-eight million two hundred and thirty thousand four hu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141045414350.html