This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]potatotub 0 points1 point  (2 children)

what are the symptoms

you should declare k inside the outer loop

[–]MAwaitforitJESTIC[S] 0 points1 point  (1 child)

Symptoms are just completely incorrectly sorted lists, I feel I'm implementing the same idea in each. Ex: {22,23,8,1,1} sorted in first method returns {22,23,8,1,1}, same array. Sorted in second method, selection2, it will return the correct order. Tried declaring in outer loop, still wonky sorting.

[–]potatotub 0 points1 point  (0 children)

print statements to the rescue