mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Add type name to Big O table (#717)
This commit is contained in:
parent
aa0f47ed65
commit
2a49b7045a
18
README.md
18
README.md
@ -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.
|
Below is the list of some of the most used Big O notations and their performance comparisons against different sizes of the input data.
|
||||||
|
|
||||||
| Big O Notation | Computations for 10 elements | Computations for 100 elements | Computations for 1000 elements |
|
| Type | Big O Notation | Computations for 10 elements | Computations for 100 elements | Computations for 1000 elements |
|
||||||
| -------------- | ---------------------------- | ----------------------------- | ------------------------------- |
|
| ----------- | -------------- | ---------------------------- | ----------------------------- | ------------------------------- |
|
||||||
| **O(1)** | 1 | 1 | 1 |
|
| Constant | **O(1)** | 1 | 1 | 1 |
|
||||||
| **O(log N)** | 3 | 6 | 9 |
|
| Logarithmic | **O(log N)** | 3 | 6 | 9 |
|
||||||
| **O(N)** | 10 | 100 | 1000 |
|
| Linear | **O(N)** | 10 | 100 | 1000 |
|
||||||
| **O(N log N)** | 30 | 600 | 9000 |
|
| n log(n) | **O(N log N)** | 30 | 600 | 9000 |
|
||||||
| **O(N^2)** | 100 | 10000 | 1000000 |
|
| Quadratic | **O(N^2)** | 100 | 10000 | 1000000 |
|
||||||
| **O(2^N)** | 1024 | 1.26e+29 | 1.07e+301 |
|
| Exponential | **O(2^N)** | 1024 | 1.26e+29 | 1.07e+301 |
|
||||||
| **O(N!)** | 3628800 | 9.3e+157 | 4.02e+2567 |
|
| Factorial | **O(N!)** | 3628800 | 9.3e+157 | 4.02e+2567 |
|
||||||
|
|
||||||
### Data Structure Operations Complexity
|
### Data Structure Operations Complexity
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user