Skip to content

Commit 7bc7356

Browse files
committed
Docstring updated
1 parent f994cb4 commit 7bc7356

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ htmlcov
4848
*~
4949
__pycache__/
5050
.pytest_cache/
51-
.idea/
5251

5352
# Backup Files #
5453
################

pydatastructs/trees/heaps.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class DHeap(Heap):
2929
List/tuple of initial elements in Heap.
3030
3131
heap_property : str
32-
The property of binary heap.
3332
If the key stored in each node is
3433
either greater than or equal to
3534
the keys in the node's children
@@ -45,7 +44,7 @@ class DHeap(Heap):
4544
========
4645
4746
>>> from pydatastructs.trees.heaps import DHeap
48-
>>> min_heap = DHeap(heap_property="min",d=3)
47+
>>> min_heap = DHeap(heap_property="min", d=3)
4948
>>> min_heap.insert(1, 1)
5049
>>> min_heap.insert(5, 5)
5150
>>> min_heap.insert(7, 7)
@@ -55,7 +54,7 @@ class DHeap(Heap):
5554
>>> min_heap.extract().key
5655
4
5756
58-
>>> max_heap = BinaryHeap(heap_property='max')
57+
>>> max_heap = DHeap(heap_property='max', d=2)
5958
>>> max_heap.insert(1, 1)
6059
>>> max_heap.insert(5, 5)
6160
>>> max_heap.insert(7, 7)
@@ -206,7 +205,6 @@ class BinaryHeap(DHeap):
206205
List/tuple of initial elements in Heap.
207206
208207
heap_property : str
209-
The property of binary heap.
210208
If the key stored in each node is
211209
either greater than or equal to
212210
the keys in the node's children
@@ -264,7 +262,6 @@ class TernaryHeap(DHeap):
264262
List/tuple of initial elements in Heap.
265263
266264
heap_property : str
267-
The property of binary heap.
268265
If the key stored in each node is
269266
either greater than or equal to
270267
the keys in the node's children
@@ -279,8 +276,8 @@ class TernaryHeap(DHeap):
279276
Examples
280277
========
281278
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")
284281
>>> min_heap.insert(1, 1)
285282
>>> min_heap.insert(5, 5)
286283
>>> min_heap.insert(7, 7)
@@ -290,7 +287,7 @@ class TernaryHeap(DHeap):
290287
>>> min_heap.extract().key
291288
4
292289
293-
>>> max_heap = BinaryHeap(heap_property='max')
290+
>>> max_heap = TernaryHeap(heap_property='max')
294291
>>> max_heap.insert(1, 1)
295292
>>> max_heap.insert(5, 5)
296293
>>> max_heap.insert(7, 7)

0 commit comments

Comments
 (0)