mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-08 19:06:00 +00:00
Reversed Linked List Traversal
Read this in other languages: 中文
The task is to traverse the given linked list in reversed order.
For example for the following linked list:
The order of traversal should be:
37 → 99 → 12
The time complexity is O(n) because we visit every node only once.