Interview Algorithm Challenge: Reverse Linked List - Swift
У вашего броузера проблема в совместимости с HTML5
Today, let's go over a very common interview question that's asked and it is to reverse a singly linked list. The solution is to use a while loop and reverse out pointers. However, because the implementation is a little difficult to follow, let's first go through how we can print out all the nodes first.
I will then walk through how the reverse implementation changes the structure of our list. Finally, we'll see what our reversed head node becomes.
Facebook Group
https://www.facebook.com/groups/1240636442694543/
iOS Basic Training Course
https://www.letsbuildthatapp.com/basic-training
Completed Source Code
https://www.letsbuildthatapp.com/course_video?id=932
Follow me on Twitter: https://twitter.com/buildthatapp