A data sorter includes a storage sorter that sorts a data set according to
a defined criteria; and a query mechanism that receives intermediate
sorted data values from the storage sorter and compares the intermediate
sorted data values to a key value. The storage sorter includes a priority
queue for sorting the data set. The priority queue has M processing
elements. The query mechanism receives the intermediate sorted data
values from the M processing elements. The query mechanism includes a
plurality of comparison circuits, each of which is capable of detecting
whether one of the intermediate sorted data values is equal to the key
value or, if no match exists, extracting a minimal value greater than (or
less than according to a defined criteria) the key value.