File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def sort(_list):
4949
return merge(a, b)
5050

5151
from itertools import zip_longest
52-
def sorti(_list):
52+
def sorti(_list, verbose=True):
5353
"""
5454
Function to sort an array
5555
using merge sort algorithm, iteratively
@@ -60,7 +60,7 @@ def sorti(_list):
6060
# breakdown every element into its own list
6161
series = [[i] for i in _list]
6262
while len(series) > 1:
63-
print(series)
63+
if verbose: print(series)
6464
# iterator to handle two at a time in the zip_longest below
6565
isl = iter(series)
6666
series = [
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class TestMergeSortIterative(unittest.TestCase, TestSortingAlgorithm):
122122

123123
@staticmethod
124124
def sort(arr):
125-
return merge_sort.sorti(arr)
125+
return merge_sort.sorti(arr, verbose=False)
126126

127127
class TestQuickSort(unittest.TestCase, TestSortingAlgorithm):
128128
inplace = False

0 commit comments

Comments
 (0)