@@ -29,7 +29,6 @@ class DHeap(Heap):
29
29
List/tuple of initial elements in Heap.
30
30
31
31
heap_property : str
32
- The property of binary heap.
33
32
If the key stored in each node is
34
33
either greater than or equal to
35
34
the keys in the node's children
@@ -45,7 +44,7 @@ class DHeap(Heap):
45
44
========
46
45
47
46
>>> from pydatastructs.trees.heaps import DHeap
48
- >>> min_heap = DHeap(heap_property="min",d=3)
47
+ >>> min_heap = DHeap(heap_property="min", d=3)
49
48
>>> min_heap.insert(1, 1)
50
49
>>> min_heap.insert(5, 5)
51
50
>>> min_heap.insert(7, 7)
@@ -55,7 +54,7 @@ class DHeap(Heap):
55
54
>>> min_heap.extract().key
56
55
4
57
56
58
- >>> max_heap = BinaryHeap (heap_property='max')
57
+ >>> max_heap = DHeap (heap_property='max', d=2 )
59
58
>>> max_heap.insert(1, 1)
60
59
>>> max_heap.insert(5, 5)
61
60
>>> max_heap.insert(7, 7)
@@ -206,7 +205,6 @@ class BinaryHeap(DHeap):
206
205
List/tuple of initial elements in Heap.
207
206
208
207
heap_property : str
209
- The property of binary heap.
210
208
If the key stored in each node is
211
209
either greater than or equal to
212
210
the keys in the node's children
@@ -264,7 +262,6 @@ class TernaryHeap(DHeap):
264
262
List/tuple of initial elements in Heap.
265
263
266
264
heap_property : str
267
- The property of binary heap.
268
265
If the key stored in each node is
269
266
either greater than or equal to
270
267
the keys in the node's children
@@ -279,8 +276,8 @@ class TernaryHeap(DHeap):
279
276
Examples
280
277
========
281
278
282
- >>> from pydatastructs.trees.heaps import BinaryHeap
283
- >>> min_heap = BinaryHeap (heap_property="min")
279
+ >>> from pydatastructs.trees.heaps import TernaryHeap
280
+ >>> min_heap = TernaryHeap (heap_property="min")
284
281
>>> min_heap.insert(1, 1)
285
282
>>> min_heap.insert(5, 5)
286
283
>>> min_heap.insert(7, 7)
@@ -290,7 +287,7 @@ class TernaryHeap(DHeap):
290
287
>>> min_heap.extract().key
291
288
4
292
289
293
- >>> max_heap = BinaryHeap (heap_property='max')
290
+ >>> max_heap = TernaryHeap (heap_property='max')
294
291
>>> max_heap.insert(1, 1)
295
292
>>> max_heap.insert(5, 5)
296
293
>>> max_heap.insert(7, 7)
0 commit comments