Academy
CoursesInstructors
Academy
HomeCoursesDashboard

© 2026 Academy. All rights reserved.

JavaScript Algorithms & Data Structures

Lesson 1 of 3

Big-O Notation, Intuitively

Reason about performance without the maths headache.

Why Big-O matters

Big-O describes how an algorithm's work grows as the input grows. It lets us compare approaches before we even run them.

  • O(1) — constant: array index access
  • O(n) — linear: a single loop
  • O(n log n) — good sorts
  • O(n²) — nested loops

A quick benchmark in JavaScript:

function sum(arr) {
  let total = 0;            // O(1)
  for (const n of arr) {    // O(n)
    total += n;
  }
  return total;
}

One loop over the input → linear, O(n).

Back toCourse overviewNext lessonArrays vs. Linked Lists

JavaScript Algorithms & Data Structures

Lesson 1 of 3 · 42m total

  1. 1Big-O Notation, Intuitively13:00
  2. 2Arrays vs. Linked Lists15:00
  3. 3Recursion & the Call Stack14:00