Interview Algorithm Challenge: Reverse Linked List - Swift

Profile Picture
- Published on Feb 17, 2019馃審 Public

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 iOS Basic Training Course Completed Source Code Follow me on Twitter: