MCPcopy Create free account
hub / github.com/BeeBombshell/Python-DSA / quicksort

Method quicksort

Sort-all/quick.py:3–6  ·  view source on GitHub ↗
(A, I, J)

Source from the content-addressed store, hash-verified

1class Solution:
2 def sortArray(self, N: List[int]) -> List[int]:
3 def quicksort(A, I, J):
4 if J - I <= 1: return
5 p = partition(A, I, J)
6 quicksort(A, I, p), quicksort(A, p + 1, J)
7
8 def partition(A, I, J):
9 A[J-1], A[(I + J - 1)//2], i = A[(I + J - 1)//2], A[J-1], I

Callers

nothing calls this directly

Calls 1

partitionFunction · 0.85

Tested by

no test coverage detected