mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-27 15:41:16 +08:00
Merge branch 'master' into dev
This commit is contained in:
commit
ef387e69c7
@ -190,7 +190,7 @@ Below is the list of some of the most used Big O notations and their performance
|
||||
| **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 log N)** | 30 | 600 | 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 |
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @return {number[][]}
|
||||
*/
|
||||
function getPossibleMoves(chessboard, position) {
|
||||
// Generate all knight moves (event those that goes beyond the board).
|
||||
// Generate all knight moves (even those that go beyond the board).
|
||||
const possibleMoves = [
|
||||
[position[0] - 1, position[1] - 2],
|
||||
[position[0] - 2, position[1] - 1],
|
||||
|
Loading…
Reference in New Issue
Block a user