Remove useless code in doctests (#7733)

* refactor: Fix matrix display deprecation

* refactor: Remove useless `print` and `pass` statements

* revert: Replace broken doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert: Fix failing doctests

* chore: Satisfy pre-commit

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Caeden Perelli-Harris
2022-10-27 21:52:00 +01:00
committed by GitHub
parent 501a1cf0c7
commit 61eedc16c3
21 changed files with 51 additions and 61 deletions

View File

@ -71,7 +71,7 @@ class BinomialHeap:
... first_heap.insert(number)
Size test
>>> print(first_heap.size)
>>> first_heap.size
30
Deleting - delete() test
@ -97,7 +97,7 @@ class BinomialHeap:
# # # #
preOrder() test
>>> print(second_heap.preOrder())
>>> second_heap.preOrder()
[(17, 0), ('#', 1), (31, 1), (20, 2), ('#', 3), ('#', 3), (34, 2), ('#', 3), ('#', 3)]
printing Heap - __str__() test

View File

@ -9,20 +9,20 @@ class Heap:
>>> unsorted = [103, 9, 1, 7, 11, 15, 25, 201, 209, 107, 5]
>>> h = Heap()
>>> h.build_max_heap(unsorted)
>>> print(h)
>>> h
[209, 201, 25, 103, 107, 15, 1, 9, 7, 11, 5]
>>>
>>> h.extract_max()
209
>>> print(h)
>>> h
[201, 107, 25, 103, 11, 15, 1, 9, 7, 5]
>>>
>>> h.insert(100)
>>> print(h)
>>> h
[201, 107, 25, 103, 100, 15, 1, 9, 7, 5, 11]
>>>
>>> h.heap_sort()
>>> print(h)
>>> h
[1, 5, 7, 9, 11, 15, 25, 100, 103, 107, 201]
"""

View File

@ -27,7 +27,7 @@ class MinHeap:
>>> myMinHeap.decrease_key(b, -17)
>>> print(b)
Node(B, -17)
>>> print(myMinHeap["B"])
>>> myMinHeap["B"]
-17
"""