O(n²) operações
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
About this calculator
The O(n²) Operations Calculator predicts the number of operations in quadratic-complexity algorithms. It uses the formula n², where 'n' is the number of input elements. For instance, 10 elements result in 100 operations, and 100 elements yield 10,000.
This tool is valuable for programmers analyzing algorithm efficiency, particularly in nested loops or sorting methods like selection sort. Quadratic complexity often appears in matrix operations and brute-force solutions. Performance degrades rapidly with larger inputs.
To use, simply input the 'n' value for calculation. High results suggest optimization is needed, such as switching to O(n log n) or O(n) algorithms for scalability in large datasets.
Frequently asked questions
Why is quadratic complexity called O(n²)?
The O(n²) notation describes how operations grow proportionally to the square of input elements.
When should I use this calculator?
Use it to assess computational costs of quadratic algorithms like nested loops and plan optimizations for large 'n' values.
Which algorithms have O(n²) complexity?
Examples include bubble sort, brute-force matrix operations, and combinatorial search algorithms without optimizations.
Is quadratic complexity efficient?
No, it's inefficient for large datasets due to exponential runtime growth. Prefer linear or logarithmic algorithms where possible.