in reply to crop-sort: Maintaining a Top-10 Array
This task is a perfect match for a heap sort. See Heap for a module that implements a huge variety of heaps.