Grokking Algorithm Complexity and Big-O
Ask Author
Back to course home

0% completed

Vote For New Content
Quadratic Space: O(n²)
On this page

Quadratic Space Complexity O(n^2) describes algorithms where the memory usage grows proportionally to the square of the input size. This type of complexity is common in dynamic programming (DP) problems that require a 2D table to store intermediate results, especially when solving problems involving grids or pairs.

Key Characteristics

In an algorithm with O(n^2) space complexity:

  • Memory usage grows with the square of the input size.
  • This is typical in algorithms that use a 2D array or matrix to store information for each pair of elements or each cell in a grid.

.....

.....

.....

Like the course? Get enrolled and start learning!

On this page