SnokenKeekaGuard@lemmy.dbzer0.com to Lemmy Shitpost@lemmy.world · 3 months agoIt do be like thatlemmy.dbzer0.comimagemessage-square10fedilinkarrow-up1352arrow-down17
arrow-up1345arrow-down1imageIt do be like thatlemmy.dbzer0.comSnokenKeekaGuard@lemmy.dbzer0.com to Lemmy Shitpost@lemmy.world · 3 months agomessage-square10fedilink
minus-squareToes♀@ani.sociallinkfedilinkarrow-up19·edit-23 months agoLet 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/
minus-squareNorthWestWind@lemmy.worldlinkfedilinkarrow-up3·3 months agoThey asked for sorting things into categories. Bucket sort is more suitable.
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/
They asked for sorting things into categories. Bucket sort is more suitable.