Reverse Linked List - Iterative solution - Leetcode 206

preview_player
Показать описание
Reverse Linked List - Iterative approach
This is a popular coding interview question asked by many tech companies.
Linked list is a popular data structure in computer science. The interview will expect a candidate to know about linked list and linked list reversal question can be a follow up question.

0:00 Introduction to linked list
1:33 What do we mean by reversing a linked list
2:09 Class for Linked list node
2:22 Logic deduction and code

The list is reversed in a single pass, therefore the complexity of this algorithm is O(n), where n is the number of elements in the list.
leetcode 206
Рекомендации по теме
Комментарии
Автор

Reverse a linked list in a single pass - complexity O(n). Please leave a comment if something I explained was not clear and I'll try and help you!
Thanks for watching!

interview_ready
welcome to shbcf.ru