# This is pseudo code for each $record (@records) { push $record into the right $bin; $records++; } $key = 1; while ($records--) { ++$key while(empty $bin{$key}); pop $record from $bin{$key} and print it; }
That's at least the way I understood what you want to do. If there's actually a sorting criteria for the output (other than "0 2 4 8 ...", this would have to be different. Unless I missed something, the problem is there's no way to tell that "1 0" comes before "2 0" or after "3 256", that is, your description is too loose.
In reply to Re: Sorting
by Anonymous Monk
in thread Sorting
by johnirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |