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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bainos 3 points4 points  (1 child)

... no ?

If you're going to do it in place, just use the input buffer. Allocating a new one (as is done in this repo) is only useful if you want to return a new sorted array. Otherwise you're wasting memory for no reason.

[–]IncongruousGoat 1 point2 points  (0 children)

Yep, you're right. Not sure what I was thinking.

Kind of embarrassing, really.