UNPKG

@dxzmpk/js-algorithms-data-structures

Version:

Algorithms and data-structures implemented on JavaScript

20 lines (11 loc) 432 B
# Reversed Linked List Traversal The task is to traverse the given linked list in reversed order. For example for the following linked list: ![](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg) The order of traversal should be: ```text 37 → 99 → 12 ``` The time complexity is `O(n)` because we visit every node only once. ## Reference - [Wikipedia](https://en.wikipedia.org/wiki/Linked_list)