Elektrine lite

← Feed

@chamaeleon@fedia.io

2026-09-01 18:08 UTC

Seems straightforward enough. For j values of 1 to i it will not do anything because the largest element in the array has already been moved to position i in some earlier iteration in the i loop. For j values greater than i it then proceeds to find the largest remaining element place in position i.

Replies (1)

  • For the j > i case I think you’re right, it sorts largest to smallest (or, backwards), but for the j i part of the algorithm. Sort of a “two wrongs that accidentally make a right” maneuver.

    Open ##4598198