SnokenKeekaGuard@lemmy.dbzer0.com to Lemmy Shitpost@lemmy.world · 4 months agoIt do be like thatlemmy.dbzer0.comexternal-linkmessage-square10fedilinkarrow-up1355arrow-down17
arrow-up1348arrow-down1external-linkIt do be like thatlemmy.dbzer0.comSnokenKeekaGuard@lemmy.dbzer0.com to Lemmy Shitpost@lemmy.world · 4 months agomessage-square10fedilink
minus-squareToes♀@ani.sociallinkfedilinkarrow-up19·edit-24 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·4 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.