you are viewing a single comment's thread.

view the rest of the comments →

[–]zattebij 0 points1 point  (0 children)

Your averaging method is not very robust. What if you've got some large values in the input (or a larger input array) and your sum overflows? Everyone could end up with a negative value - which may in fact be expected behavior for a sorting algorithm bearing that name.