Skip to content

Commit

Permalink
Restructure the Big O Notation table.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Jan 26, 2022
1 parent 9ca459f commit 1216d00
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ Source: [Big O Cheat Sheet](http://bigocheatsheet.com/).

Below is the list of some of the most used Big O notations and their performance comparisons against different sizes of the input data.

| Type | Big O Notation | Computations for 10 elements | Computations for 100 elements | Computations for 1000 elements |
| ----------- | -------------- | ---------------------------- | ----------------------------- | ------------------------------- |
| Constant | **O(1)** | 1 | 1 | 1 |
| Logarithmic | **O(log N)** | 3 | 6 | 9 |
| Linear | **O(N)** | 10 | 100 | 1000 |
| n log(n) | **O(N log N)** | 30 | 600 | 9000 |
| Quadratic | **O(N^2)** | 100 | 10000 | 1000000 |
| Exponential | **O(2^N)** | 1024 | 1.26e+29 | 1.07e+301 |
| Factorial | **O(N!)** | 3628800 | 9.3e+157 | 4.02e+2567 |
| Big O Notation | Type | Computations for 10 elements | Computations for 100 elements | Computations for 1000 elements |
| -------------- | ----------- | ---------------------------- | ----------------------------- | ------------------------------- |
| **O(1)** | Constant | 1 | 1 | 1 |
| **O(log N)** | Logarithmic | 3 | 6 | 9 |
| **O(N)** | Linear | 10 | 100 | 1000 |
| **O(N log N)** | n log(n) | 30 | 600 | 9000 |
| **O(N^2)** | Quadratic | 100 | 10000 | 1000000 |
| **O(2^N)** | Exponential | 1024 | 1.26e+29 | 1.07e+301 |
| **O(N!)** | Factorial | 3628800 | 9.3e+157 | 4.02e+2567 |

### Data Structure Operations Complexity

Expand Down

0 comments on commit 1216d00

Please sign in to comment.