LazySorted: A lazily, partially sorted Python list

0Citations
Citations of this article
5Readers
Mendeley users who have this article in their library.

Abstract

LazySorted is a Python C extension implementing a partially and lazily sorted list data structure. It solves a common problem faced by programmers, in which they need just part of a sorted list, like its middle element (the median), but sort the entire list to get it. LazySorted presents them with the abstraction that they are working with a fully sorted list, while actually only sorting the list partially with quicksort partitions to return the requested sub-elements. This enables programmers to use naive “sort rst” algorithms but nonetheless attain linear run-times when possible. LazySorted may serve as a drop-in replacement for the built-in sorted function in most cases, and can sometimes achieve run-times more than 7 times faster.

Author supplied keywords

Cite

CITATION STYLE

APA

Harris, N. (2015). LazySorted: A lazily, partially sorted Python list. Journal of Statistical Software, 65(CODESNIPPET 1), 1–10. https://doi.org/10.18637/jss.v065.c01

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free