Problem: Top‐k problem is to select k minimum or
maximum elements from a data collection.
Solution:
Step 1: Local sort. Divide the data collection into
small data partitions with equal size, then store and
sort them in the shared memory concurrently.
Step 2: Approximate top‐k queue. Form a data
collection using the heads of each sorted queues, then
a insertion sort is performed on it to pick out the
approximate top‐k queue.
Step 3: Global top‐k queue. Based on the
approximate top‐k queue, A, and k local sorted queues,
whose heads are in A and sorted according to their
heads, the exclusive property is applied to produce the
global top‐k queue.