MCPcopy Create free account
hub / github.com/geekcomputers/Python / Insertion_Sort

Function Insertion_Sort

Sorting Algorithms/Linear_Insertion_Sort.py:9–15  ·  view source on GitHub ↗
(Test_arr)

Source from the content-addressed store, hash-verified

7
8
9def Insertion_Sort(Test_arr):
10 for i in range(1, len(Test_arr)):
11 val = Test_arr[i]
12 j = Linear_Search(Test_arr[:i], val)
13 Test_arr.pop(i)
14 Test_arr.insert(j, val)
15 return Test_arr
16
17
18if __name__ == "__main__":

Callers 1

Calls 3

Linear_SearchFunction · 0.85
popMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected