def testQuickSort() -> bool: size = 32768 arr = [0] * size SequenceBuilder.packRandom(arr) checksum = Sequences.parityChecksum(arr) QuickSort.sort(arr) if Sequences.parityChecksum(arr) != checksum: return False return Sequences.isSorted(arr)
def testSelectionSort() -> bool: size = 32768 arr = [0] * size SequenceBuilder.packRandom(arr) checksum = Sequences.parityChecksum(arr) Sorting.selectionSort(arr) if Sequences.parityChecksum(arr) != checksum: return False return Sequences.isSorted(arr)
def packDecreasing(arr: list) -> None: packIncreasing(arr) Sequences.reverse(arr)