mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 23:21:18 +08:00
Add big O info.
This commit is contained in:
parent
1c1826daa9
commit
b388cfeba8
@ -9,3 +9,13 @@
|
|||||||
## Big O Notation
|
## Big O Notation
|
||||||
|
|
||||||
![Big O graphs](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-O-graph.jpeg)
|
![Big O graphs](https://github.com/trekhleb/javascript-algorithms/blob/master/assets/big-O-graph.jpeg)
|
||||||
|
|
||||||
|
| Big O Notation | Computations for 10 elements | Computations for 100 elements | Computations for 10 elements |
|
||||||
|
| -------------- | ---------------------------- | ----------------------------- | ----------------------------- |
|
||||||
|
| O(1) | 1 | 1 | 1 |
|
||||||
|
| O(log N) | 3 | 6 | 9 |
|
||||||
|
| O(N) | 10 | 100 | 1000 |
|
||||||
|
| O(N log N) | 30 | 60 | 9000 |
|
||||||
|
| O(N^2) | 100 | 10000 | 1000000 |
|
||||||
|
| O(2^N) | 1024 | 1.26e+29 | 1.07e+301 |
|
||||||
|
| O(N!) | 3628800 | 9.3e+157 | 4.02e+2567 |
|
||||||
|
Loading…
Reference in New Issue
Block a user