Comment on It do be like that
Toes@ani.social 4 months ago
Let me help you sort things out:
def bubbleSort(arr): n = len(arr) for i in range(n-1): for j in range(0, n-i-1): if arr[j] > arr[j+1]: arr[j], arr[j+1] = arr[j+1], arr[j] #https://www.sortvisualizer.com/bubblesort/
NorthWestWind@lemmy.world 4 months ago
They asked for sorting things into categories. Bucket sort is more suitable.