mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Update Permutation and Combination cheatsheets. (#963)
This commit is contained in:
@@ -4,13 +4,13 @@ When the order doesn't matter, it is a **Combination**.
|
||||
|
||||
When the order **does** matter it is a **Permutation**.
|
||||
|
||||
**"The combination to the safe is 472"**. We do care about the order. `724` won't work, nor will `247`.
|
||||
**"The combination to the safe is 472"**. We do care about the order. `724` won't work, nor will `247`.
|
||||
It has to be exactly `4-7-2`.
|
||||
|
||||
## Permutations without repetitions
|
||||
|
||||
A permutation, also called an “arrangement number” or “order”, is a rearrangement of
|
||||
the elements of an ordered list `S` into a one-to-one correspondence with `S` itself.
|
||||
A permutation, also called an “arrangement number” or “order”, is a rearrangement of
|
||||
the elements of an ordered list `S` into a one-to-one correspondence with `S` itself.
|
||||
|
||||
Below are the permutations of string `ABC`.
|
||||
|
||||
@@ -37,19 +37,17 @@ For example the the lock below: it could be `333`.
|
||||
n * n * n ... (r times) = n^r
|
||||
```
|
||||
|
||||
## Cheat Sheets
|
||||
## Cheatsheet
|
||||
|
||||
Permutations cheat sheet
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
Combinations cheat sheet
|
||||
| | |
|
||||
| --- | --- |
|
||||
| |  |
|
||||
|
||||

|
||||
|
||||
Permutations/combinations algorithm ideas.
|
||||
|
||||

|
||||
*Made with [okso.app](https://okso.app)*
|
||||
|
||||
## References
|
||||
|
||||
|
||||
BIN
src/algorithms/sets/permutations/images/overview.png
Normal file
BIN
src/algorithms/sets/permutations/images/overview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 307 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 301 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 364 KiB |
Reference in New Issue
Block a user