At Newzbin we used a simple partial quicksort for returning paginated results from our custom search engine - it worked really well for our needs.<p>It was implemented as a plain old C macro: <a href="https:&#x2F;&#x2F;github.com&#x2F;Freaky&#x2F;pqsort" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Freaky&#x2F;pqsort</a>