Foundations
Linear Structures
Hashing
Array and String Patterns
Recursion, Search, and Sorting
Problem Solving Patterns
Algorithm Searching
Sorting Algorithms
Array Algorithms
Grid Algorithms
Linear Structure Algorithms
Hashing Algorithms
Recursion and Backtracking
Greedy Algorithms
Tree and Heap Algorithms
Graph Algorithms
Dynamic Programming Algorithms
String Algorithms
Math Algorithms
Keyboard ready
Space plays. Arrow keys step. R restarts.
LAB Linked List Traversal Lab
Linked Lists
Problem shape
Beginner
7
->
11
->
18
->
24
Core idea
Follow next pointers until the list ends.
Step 1 / 5
Problem shape
Linked Lists Beginner
Linked List Traversal
Welcome to the Linked List Traversal algorithm lab. Follow next pointers until the list ends. Use it when: Use before searching, counting, printing, or transforming a linked list. The time complexity is O(n), and the space complexity is O(1). The pseudocode is: node = head while node is not null visit node.value node = node.next As you practice, track the state that changes and the condition that makes the algorithm stop.
Time
O(n)
Space
O(1)
Pseudocode
node = head
while node is not null
visit node.value
node = node.next 1.0x