MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / bitonicSort

Function bitonicSort

sorts/BitonicSort.py:30–37  ·  view source on GitHub ↗
(a, low, cnt, dire)

Source from the content-addressed store, hash-verified

28# sorting its two halves in opposite sorting orders, and then
29# calls bitonicMerge to make them in the same order
30def bitonicSort(a, low, cnt, dire):
31 if cnt > 1:
32 k = int(cnt / 2)
33 bitonicSort(a, low, k, 1)
34 bitonicSort(a, low + k, k, 0)
35 bitonicMerge(a, low, cnt, dire)
36
37 # Caller of bitonicSort for sorting the entire array of length N
38
39
40# in ASCENDING order

Callers 1

sortFunction · 0.85

Calls 1

bitonicMergeFunction · 0.85

Tested by

no test coverage detected