Quick Sort in Python
@Dagmawi_Babi
def sort(array):#Telegram #Code #QuickSort #Python
#Sort the array by using quicksort
less = []
equal = []
greater = []
if len(array) > 1:
pivot = array[0]
for x in array:
if x < pivot:
less.append(x)
elif x == pivot:
equal.append(x)
elif x > pivot:
greater.append(x)
return sort(less)+equal+sort(greater)
else:
return array
@Dagmawi_Babi