Follow

@LottieVixen@dev.glitch.social yeah, but now you can't get an element

imagine sorting the list [3,2,1]

you're gonna look through for the lowest one, so after one iteration you have

result = [1]
list = [3,2,1]

but now you're ignoring the first element, so your second iteration will only see

list = [2,1]

and you'll select 1 again

and so after all 3 iterations, you'll get a result of [1,1,1]

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!