MCPcopy Index your code
hub / github.com/BeeBombshell/Python-DSA / insertion_sort

Method insertion_sort

Sort-all/bucket.py:3–9  ·  view source on GitHub ↗
(A)

Source from the content-addressed store, hash-verified

1class Solution:
2 def sortArray(self, N: List[int]) -> List[int]:
3 def insertion_sort(A):
4 for i in range(1,len(A)):
5 for j in range(0,i):
6 if A[i] < A[j]:
7 A.insert(j, A.pop(i))
8 break
9 return A
10
11 def bucketsort(A):
12 buckets, m, S = [[] for _ in range(1000)], min(A), []

Callers

nothing calls this directly

Calls 2

popMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected