Skip to content
Tactiverge

Learning Rooms/○ Level 3 · Innovator/Computing and algorithms

Big O Notation

HackerRank · Length: see YouTube · captions on YouTube · nothing loads until you press play

By the end you can…

  • Express an operation count in big-O notation by keeping the fastest-growing term and dropping constants.
  • Rank O(1), O(log n), O(n), O(n log n), O(n²) and O(n³) and predict the effect of doubling n.
  • Use a measured time and a growth rate to predict the time for a larger input.
?Predict▶Watch✓Practise⚙Build

Watch it all: no segment has been checked by hand for this video yet.

1.Predict before you press play

A = 3n² + 50n + 1000 steps, B = 400n steps. For n = 1,000,000, roughly how many times more steps does A take?

Pick one before you press play. A wrong guess is fine: it is what makes the video stick.

2.See the idea first

Play with this diagram for a minute. It gives you something to hang the video on.

Loading the interactive…

Can't use the diagram? Read a description instead

The plotter shows log n, n, n log n and n² against n, optionally on a logarithmic y-axis. A slider multiplies n log n by a constant; with a constant of 20, n² is cheaper until about n = 145, after which n² grows far faster.

3.Watch, actively

Explains why big-O drops constants and smaller terms, with worked examples of loops and nested loops.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

Watch for…

  • → Watch why constants and smaller terms are dropped, and how nested loops lead to O(n²).

Pause whenever you like. Rewatching a hard minute is a good habit, not a failure.

Can't stream it? Read the idea instead

Big-O describes how the work an algorithm does grows as its input grows, ignoring constant factors and smaller terms. A single loop over n items is O(n); a loop inside a loop is O(n²). For large inputs, the growth rate matters far more than the constant.

What the video covers (our own note, written when we verified it): Explains why big-O drops constants and smaller terms, with worked examples of loops and nested loops.

Written by Tactiverge in our own words, not a transcript. The full lesson below explains the idea without the video.

Read it instead

Jot down one thing that surprised you and one question you still have.

Private: saved only on this device, never sent to Tactiverge.

4.Practise what you just saw

These come from the lesson that use this video and are checked on the server. Wrong answers get a hint and another try.

Practice 1 · a fresh version every time

Timing tests show a parts-matching script grows like n² and takes 12 ms for n = 1024. Assuming that growth holds, predict its time for n = 4096, in ms.

ms

Practice 2

Which list is in order from slowest-growing to fastest-growing?

Practice 3

Algorithm X is O(n log n) and Y is O(n²). Which statement is true?

Practice 4

An exact count is T(n) = 7n + 3n·log₂n + 12. What is its big-O?

5.Try it yourself

No simulation models this idea yet. The lesson below has an interactive diagram instead.

6.Where engineers use it

Choosing an O(n log n) planner step over an O(n²) one is often the difference between a robot that replans in real time on a big warehouse map and one that freezes.

From the applied view in the lesson Big-O: the shape of growth. Checked by automated tests only.

7.Build something with it

Follow-up project

Write the big-O of each function in your planner package (loading, neighbours, BFS, report). Pick the one with the worst growth and predict how its time changes when the map grows from 50 × 50 to 200 × 200. Keep the prediction for the next lesson's measurements.

Where this video lives

In the course catalogue: CSE-320 Algorithms and numerical computation

The video is by HackerRank, embedded from YouTube with privacy-enhanced mode and never autoplayed. The room around it (prompts, notes, practice, projects) is Tactiverge's, written with AI assistance and checked by automated tests only.