Merge branch 'trekhleb:master' into master

This commit is contained in:
keithbored3310 2022-08-30 22:13:56 +08:00 committed by GitHub
commit b95cb8bbb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 139 additions and 99 deletions

View File

@ -301,7 +301,8 @@ npm test -- 'playground'
### References
[▶ Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)
- [▶ Data Structures and Algorithms on YouTube](https://www.youtube.com/playlist?list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8)
- [✍🏻 Data Structure Sketches](https://okso.app/showcase/data-structures)
### Big O Notation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 213 KiB

View File

@ -16,7 +16,9 @@ dans le cas orienté. Les sommets peuvent faire partie
de la structure, ou être des entités extérieures,
représentées par des entiers ou des références.
![Graph](https://www.tutorialspoint.com/data_structures_algorithms/images/graph.jpg)
![Graph](./images/graph.jpeg)
*Made with [okso.app](https://okso.app)*
## References

View File

@ -22,7 +22,9 @@ for a directed graph. The vertices may be part of
the graph structure, or may be external entities
represented by integer indices or references.
![Graph](https://www.tutorialspoint.com/data_structures_algorithms/images/graph.jpg)
![Graph](./images/graph.jpeg)
*Made with [okso.app](https://okso.app)*
## References

View File

@ -17,7 +17,9 @@ para um grafo direcionado.
Os vértices podem fazer parte a estrutura do grafo, ou podem
ser entidades externas representadas por índices inteiros ou referências.
![Graph](https://www.tutorialspoint.com/data_structures_algorithms/images/graph.jpg)
![Graph](./images/graph.jpeg)
*Made with [okso.app](https://okso.app)*
## Referências

View File

@ -14,7 +14,9 @@
информатике, могут быть представлены графами. Например, строение Википедии можно смоделировать при помощи
ориентированного графа, в котором вершины — это статьи, а дуги (ориентированные рёбра) — гиперссылки.
![Граф](https://www.tutorialspoint.com/data_structures_algorithms/images/graph.jpg)
![Граф](./images/graph.jpeg)
*Made with [okso.app](https://okso.app)*
## Ссылки

View File

@ -11,9 +11,9 @@
如果顶点对之间的边是有权重的,该图可称为加权图。
![Graph](./images/graph.jpeg)
![Graph](https://www.tutorialspoint.com/data_structures_algorithms/images/graph.jpg)
*Made with [okso.app](https://okso.app)*
## 参考

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

View File

@ -17,11 +17,13 @@ hachage où la fonction de hachage génère le même index
pour plusieurs clés. De telles collisions doivent être
accommodées d'une manière ou d'une autre.
![Hash Table](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
Collision de hachage résolue par chaînage séparé.
![Hash Collision](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
## Références

View File

@ -4,11 +4,13 @@
理想的には、ハッシュ関数は各キーを一意のバケットに割り当てますが、ほとんどのハッシュテーブルは不完全なハッシュ関数を採用しているため、複数のキーに対して同じインデックスを生成した時にハッシュの衝突が起こります。このような衝突は何らかの方法で対処する必要があります。
![Hash Table](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
チェイン法によるハッシュの衝突の解決例
![Hash Collision](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
## 参考

View File

@ -11,11 +11,15 @@ _Read this in other languages:_
이상적으로, 해시 함수는 각 키들을 고유 버킷에 할당하지만 대부분의 해시 테이블은 불완전한 해시 함수를 사용하기 때문에 해시 함수를 통해 두 개 이상의 키에 대해 동일한 인덱스를 생성하는 해시 충돌이 발생할 수 있습니다. 이러한 해시 충돌은 어떠한 방법으로든 해결되어야 합니다.
![Hash Table](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
*Made with [okso.app](https://okso.app)*
다음은 분리 연결법을 통해 해시 충돌을 해결한 예시입니다.
![Hash Collision](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
## 참고

View File

@ -22,11 +22,13 @@ collisions where the hash function generates the same
index for more than one key. Such collisions must be
accommodated in some way.
![Hash Table](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
Hash collision resolved by separate chaining.
![Hash Collision](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
## References

View File

@ -13,11 +13,13 @@ imperfeita, pela qual poderá causar colisões de hashes onde a função de hash
gera o mesmo índice para mais de uma chave.Tais colisões devem ser
acomodados de alguma forma.
![Hash Table](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
Colisão de hash resolvida por encadeamento separado.
![Hash Collision](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
## Referências

View File

@ -5,7 +5,7 @@
быть найдено желаемое значение. Ниже представлена хеш-таблица, в которой ключом выступает имя человека, а значениями
являются телефонные номера. Хеш-функция преобразует ключ-имя в индекс массива с телефонными номерами.
![Хеш-таблица](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
В идеале хеш-функция будет присваивать элементу массива уникальный ключ. Однако большинство реальных хеш-таблиц
используют несовершенные хеш-функции. Это может привести к ситуациям, когда хеш-функция генерирует одинаковый индекс для
@ -14,9 +14,13 @@
Существует два варианта решения коллизий - хеш-таблица с цепочками и с открытой адресацией.
Метод цепочек подразумевает хранение значений, соответствующих одному и тому же индексу в виде связного списка(цепочки).
![Хеш цепочки](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
Метод открытой адресации помещает значение, для которого получен дублирующий индекс, в первую свободную ячейку.
![Хеш открытая адресация](https://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/Hash_table_5_0_1_1_1_1_0_SP.svg/380px-Hash_table_5_0_1_1_1_1_0_SP.svg.png)
## Ссылки

View File

@ -9,11 +9,15 @@
以某种方式进行处理。
![Hash Table](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)
![Hash Table](./images/hash-table.jpeg)
*Made with [okso.app](https://okso.app)*
通过单独的链接解决哈希冲突
![Hash Collision](https://upload.wikimedia.org/wikipedia/commons/d/d0/Hash_table_5_0_1_1_1_1_1_LL.svg)
![Hash Collision](./images/collision-resolution.jpeg)
*Made with [okso.app](https://okso.app)*
## 参考

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

@ -28,7 +28,9 @@ operations on hash tables.
A binary search tree of size 9 and depth 3, with 8 at the root.
The leaves are not drawn.
![Binary Search Tree](https://upload.wikimedia.org/wikipedia/commons/d/da/Binary_search_tree.svg)
![Trie](./images/binary-search-tree.jpg)
*Made with [okso.app](https://okso.app)*
## Pseudocode for Basic Operations

View File

@ -26,8 +26,9 @@ Uma pesquisa de árvore binária de tamanho 9 e profundidade 3, com valor 8
na raíz.
As folhas não foram desenhadas.
![Trie](./images/binary-search-tree.jpg)
![Binary Search Tree](https://upload.wikimedia.org/wikipedia/commons/d/da/Binary_search_tree.svg)
*Made with [okso.app](https://okso.app)*
## Pseudocódigo para Operações Básicas

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 229 KiB

View File

@ -20,7 +20,9 @@ and with some inner nodes that correspond to keys of interest.
For the space-optimized presentation of prefix tree, see compact
prefix tree.
![Trie](https://upload.wikimedia.org/wikipedia/commons/b/be/Trie_example.svg)
![Trie](./images/trie.jpg)
*Made with [okso.app](https://okso.app)*
## References

View File

@ -17,7 +17,9 @@ internos que correspondem a chaves de interesse.
Para a apresentação otimizada do espaço da árvore de prefixo (_prefix tree_),
veja árvore de prefixo compacto.
![Trie](https://upload.wikimedia.org/wikipedia/commons/b/be/Trie_example.svg)
![Trie](./images/trie.jpg)
*Made with [okso.app](https://okso.app)*
## Referências

View File

@ -16,7 +16,9 @@
дополнительную информацию, связанную с ключом, и обычно выделенными являются только листья и, возможно, некоторые
внутренние узлы.
![Префиксное дерево](https://upload.wikimedia.org/wikipedia/commons/b/be/Trie_example.svg)
![Префиксное дерево](./images/trie.jpg)
*Made with [okso.app](https://okso.app)*
На рисунке представлено префиксное дерево, содержащее ключи «A», «to», «tea», «ted», «ten», «i», «in», «inn».

View File

@ -8,7 +8,9 @@
有关字典树的空间优化示意,请参阅紧凑前缀树
![Trie](https://upload.wikimedia.org/wikipedia/commons/b/be/Trie_example.svg)
![Trie](./images/trie.jpg)
*Made with [okso.app](https://okso.app)*
## 参考

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB