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

0% completed

Quadratic Time: O(n²)
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Quadratic Time Complexity O(n^2) describes algorithms where the runtime grows proportionally to the square of the input size. In other words, if the input size doubles, the time taken by the algorithm quadruples. This complexity commonly appears in algorithms with nested loops, where each loop iterates over the input.

Key Characteristics

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

  • The runtime increases quadratically as the input size grows.
  • This complexity is often seen in algorithms where each element is compared with every other element, such as certain sorting algorithms

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible