diff --git a/src/data-structures/heap/README.fr-FR.md b/src/data-structures/heap/README.fr-FR.md index 49ad73cc..56f184b5 100644 --- a/src/data-structures/heap/README.fr-FR.md +++ b/src/data-structures/heap/README.fr-FR.md @@ -4,11 +4,15 @@ En informatique, un **tas** est une structure de données arborescente spéciali Dans un *tas minimal* (en anglais *min heap*), si `P` est un nœud parent de `C`, alors la clé (la valeur) de `P` est inférieure ou égale à la clé de `C`. -![MinHeap](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* Dans un *tas maximal* (en anglais *max heap*), la clé de `P` est supérieure ou égale à la clé de `C`. -![Heap](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) Le nœud au «sommet» du tas sans parents est appelé le nœud racine. diff --git a/src/data-structures/heap/README.ja-JP.md b/src/data-structures/heap/README.ja-JP.md index 465e11a0..13d3e363 100644 --- a/src/data-structures/heap/README.ja-JP.md +++ b/src/data-structures/heap/README.ja-JP.md @@ -4,11 +4,15 @@ *最小ヒープ*では、もし`P`が`C`の親ノードの場合、`P`のキー(値)は`C`のキーより小さい、または等しくなります。 -![MinHeap](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* *最大ヒープ*では、`P`のキーは`C`のキーより大きい、もしくは等しくなります。 -![Heap](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) ヒープの「トップ」のノードには親ノードが存在せず、ルートノードと呼ばれます。 diff --git a/src/data-structures/heap/README.ko-KR.md b/src/data-structures/heap/README.ko-KR.md index ace702da..136a87b4 100644 --- a/src/data-structures/heap/README.ko-KR.md +++ b/src/data-structures/heap/README.ko-KR.md @@ -4,11 +4,15 @@ *최소 힙*에서 `P`가 `C`의 상위 노드라면 `P`의 키(값)는 `C`의 키보다 작거나 같습니다. -![MinHeap](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* *최대 힙*에서 `P`의 키는 `C`의 키보다 크거나 같습니다. -![Heap](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) 상위 노드가 없는 힙의 "상단"에 있는 노드를 루트 노드라고 합니다. diff --git a/src/data-structures/heap/README.md b/src/data-structures/heap/README.md index 2610a9ff..ef1d2e8b 100644 --- a/src/data-structures/heap/README.md +++ b/src/data-structures/heap/README.md @@ -17,12 +17,16 @@ In a *min heap*, if `P` is a parent node of `C`, then the key (the value) of `P` is less than or equal to the key of `C`. -![MinHeap](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* In a *max heap*, the key of `P` is greater than or equal to the key of `C` -![Heap](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) The node at the "top" of the heap with no parents is called the root node. diff --git a/src/data-structures/heap/README.pt-BR.md b/src/data-structures/heap/README.pt-BR.md index e78f6c19..f229048d 100644 --- a/src/data-structures/heap/README.pt-BR.md +++ b/src/data-structures/heap/README.pt-BR.md @@ -6,12 +6,16 @@ baseada em uma árvore especializada que satisfaz a propriedade _heap_ descrita Em um *heap mínimo* (min heap), caso `P` é um nó pai de `C`, então a chave (o valor) de `P` é menor ou igual a chave de `C`. -![MinHeap](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* Em uma *heap máximo* (max heap), a chave de `P` é maior ou igual a chave de `C`. -![Heap](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) O nó no "topo" do _heap_, cujo não possui pais, é chamado de nó raiz. diff --git a/src/data-structures/heap/README.ru-RU.md b/src/data-structures/heap/README.ru-RU.md index 760fc479..4c074d1f 100644 --- a/src/data-structures/heap/README.ru-RU.md +++ b/src/data-structures/heap/README.ru-RU.md @@ -4,11 +4,15 @@ если B является узлом-потомком узла A, то ключ(A) ≥ ключ(B). Из этого следует, что элемент с наибольшим ключом всегда является корневым узлом кучи, поэтому иногда такие кучи называют max-кучами. -![Max-куча](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) Если сравнение перевернуть, то наименьший элемент будет всегда корневым узлом, такие кучи называют min-кучами. -![Min-куча](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* Не существует никаких ограничений относительно того, сколько узлов-потомков имеет каждый узел кучи. На практике их число обычно не более двух. Куча является максимально эффективной реализацией абстрактного типа данных, который diff --git a/src/data-structures/heap/README.tr-TR.md b/src/data-structures/heap/README.tr-TR.md index b741ef30..05906391 100644 --- a/src/data-structures/heap/README.tr-TR.md +++ b/src/data-structures/heap/README.tr-TR.md @@ -4,15 +4,19 @@ Bilgisayar biliminde, **yığın (heap)** aşağıda açıklanan özellikleri ka *min heap*, Eğer `P`, `C`'nin üst düğümü ise, `P`'nin anahtarı (değeri) `C`'nin anahtarından (değerinden) küçük veya ona eşittir. -![MinHeap](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) +![MinHeap](./images/min-heap.jpeg) -*max heap*, `P`'nin anahtarı `C`'nin anahtarından büyük veya eşittir. +*Made with [okso.app](https://okso.app)* -![Heap](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) +*max heap*, `P`'nin anahtarı `C`'nin anahtarından büyük veya eşittir. + +![MaxHeap](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) Yığının (Heap) "en üstündeki" ebeveyni olmayan düğüme kök düğüm (root node) denir. ## Referanslar - [Wikipedia](https://en.wikipedia.org/wiki/Heap_(data_structure)) -- [YouTube](https://www.youtube.com/watch?v=t0Cq6tVNRBA&index=5&t=0s&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) \ No newline at end of file +- [YouTube](https://www.youtube.com/watch?v=t0Cq6tVNRBA&index=5&t=0s&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) diff --git a/src/data-structures/heap/README.zh-CN.md b/src/data-structures/heap/README.zh-CN.md index 4c1ecaf0..8ba42dfb 100644 --- a/src/data-structures/heap/README.zh-CN.md +++ b/src/data-structures/heap/README.zh-CN.md @@ -1,19 +1,23 @@ -# 堆 (数据结构) - -在计算机科学中, 一个 **堆(heap)** 是一种特殊的基于树的数据结构,它满足下面描述的堆属性。 - -在一个 *最小堆(min heap)* 中, 如果 `P` 是 `C` 的一个父级节点, 那么 `P` 的key(或value)应小于或等于 `C` 的对应值. - -![最小堆](https://upload.wikimedia.org/wikipedia/commons/6/69/Min-heap.png) - -在一个 *最大堆(max heap)* 中, `P` 的key(或value)大于 `C` 的对应值。 - -![堆](https://upload.wikimedia.org/wikipedia/commons/3/38/Max-Heap.svg) - - -在堆“顶部”的没有父级节点的节点,被称之为根节点。 - -## 参考 - -- [Wikipedia](https://en.wikipedia.org/wiki/Heap_(data_structure)) -- [YouTube](https://www.youtube.com/watch?v=t0Cq6tVNRBA&index=5&t=0s&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) +# 堆 (数据结构) + +在计算机科学中, 一个 **堆(heap)** 是一种特殊的基于树的数据结构,它满足下面描述的堆属性。 + +在一个 *最小堆(min heap)* 中, 如果 `P` 是 `C` 的一个父级节点, 那么 `P` 的key(或value)应小于或等于 `C` 的对应值. + +![M最小堆](./images/min-heap.jpeg) + +*Made with [okso.app](https://okso.app)* + +在一个 *最大堆(max heap)* 中, `P` 的key(或value)大于 `C` 的对应值。 + +![堆](./images/max-heap.jpeg) + +![Array Representation](./images/array-representation.jpeg) + + +在堆“顶部”的没有父级节点的节点,被称之为根节点。 + +## 参考 + +- [Wikipedia](https://en.wikipedia.org/wiki/Heap_(data_structure)) +- [YouTube](https://www.youtube.com/watch?v=t0Cq6tVNRBA&index=5&t=0s&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) diff --git a/src/data-structures/heap/images/array-representation.jpeg b/src/data-structures/heap/images/array-representation.jpeg new file mode 100644 index 00000000..123b641c Binary files /dev/null and b/src/data-structures/heap/images/array-representation.jpeg differ diff --git a/src/data-structures/heap/images/max-heap.jpeg b/src/data-structures/heap/images/max-heap.jpeg new file mode 100644 index 00000000..1ec1fea2 Binary files /dev/null and b/src/data-structures/heap/images/max-heap.jpeg differ diff --git a/src/data-structures/heap/images/min-heap.jpeg b/src/data-structures/heap/images/min-heap.jpeg new file mode 100644 index 00000000..14867c1a Binary files /dev/null and b/src/data-structures/heap/images/min-heap.jpeg differ