DEV Community

Sreya Satheesh
Sreya Satheesh

Posted on

Understanding time & space, visually

Ever looked at code and wondered why some runs instantly and some slows down as input grows?

A new section has been added to make time and space complexity easier to understand visually.

👉 https://decoded-app.com/complexity

What’s included

Instead of treating Big-O as theory, this section focuses on how things actually behave.

Visual comparison of complexities

You can see how different complexities grow as input increases:

  1. O(1)
  2. O(log n)
  3. O(n)
  4. O(n log n)
  5. O(n²)

The idea is simple — understand how the number of steps increases.

Code → complexity mapping

Common patterns are broken down so it’s easier to identify complexity directly from code:

  1. constant operations
  2. single loops
  3. nested loops
  4. input shrinking patterns

Space complexity

There’s also a separate section for memory usage:

  1. constant space
  2. linear space
  3. recursive space

Focused on how and when memory grows.


That’s the update :)

Top comments (0)