filmov
tv
Reverse A Linked List - 3 Difficulties (on Leetcode)

Показать описание
Reversing a linked list is a famous problem. In this video we'll go over three levels of difficulty of reversing a linked list:
1) Reversing the entire list
2) Reversing the list from node m to node n
3) Reversing the list in k groups
For all three solutions we'll use the iterative approach of traversing, which is the best time/space complexity, which changes the node's next pointers to point to the previous node in the list.