UNPKG

@dxzmpk/js-algorithms-data-structures

Version:

Algorithms and data-structures implemented on JavaScript

23 lines (13 loc) 509 B
# Linked List Traversal _Read this in other languages:_ [_Русский_](README.ru-RU.md) The task is to traverse the given linked list in straight order. For example for the following linked list: ![Singly linked list](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg) The order of traversal should be: ```text 12 → 99 → 37 ``` The time complexity is `O(n)` because we visit every node only once. ## Reference - [Wikipedia](https://en.wikipedia.org/wiki/Linked_list)