๐”– Bobbio Scriptorium
โœฆ   LIBER   โœฆ

Introspective Sorting and Selection Algorithms

โœ Scribed by DAVID R. MUSSER


Publisher
John Wiley and Sons
Year
1997
Tongue
English
Weight
93 KB
Volume
27
Category
Article
ISSN
0038-0644

No coin nor oath required. For personal study only.

โœฆ Synopsis


Quicksort is the preferred in-place sorting algorithm in many contexts, since its average computing time on uniformly distributed inputs is ฮ˜(N log N), and it is in fact faster than most other sorting algorithms on most inputs. Its drawback is that its worst-case time bound is ฮ˜(N 2 . Previous attempts to protect against the worst case by improving the way quicksort chooses pivot elements for partitioning have increased the average computing time too much -one might as well use heapsort, which has a ฮ˜(N log N) worst-case time bound, but is on the average 2-5 times slower than quicksort. A similar dilemma exists with selection algorithms (for finding the i-th largest element) based on partitioning. This paper describes a simple solution to this dilemma: limit the depth of partitioning, and for subproblems that exceed the limit switch to another algorithm with a better worst-case bound. Using heapsort as the 'stopper' yields a sorting algorithm that is just as fast as quicksort in the average case, but also has an ฮ˜(N log N) worst case time bound. For selection, a hybrid of Hoare's FIND algorithm, which is linear on average but quadratic in the worst case, and the Blum-Floyd-Pratt-Rivest-Tarjan algorithm is as fast as Hoare's algorithm in practice, yet has a linear worst-case time bound. Also discussed are issues of implementing the new algorithms as generic algorithms, and accurately measuring their performance in the framework of the C++ Standard Template Library.


๐Ÿ“œ SIMILAR VOLUMES


Introspective sorting and selection revi
โœ John D. Valois ๐Ÿ“‚ Article ๐Ÿ“… 2000 ๐Ÿ› John Wiley and Sons ๐ŸŒ English โš– 221 KB

We describe two improvements to introspective sorting and selection algorithms: a simple rule for finegrained introspection that detects potential worst-case performance after only a small constant number of partitioning steps, and the use of remedial randomization as an intervention strategy in ord

The performance of a selection of sortin
โœ DOWSING, R. D.; MARTINS, W. S. ๐Ÿ“‚ Article ๐Ÿ“… 1998 ๐Ÿ› John Wiley and Sons ๐ŸŒ English โš– 289 KB ๐Ÿ‘ 2 views

In the past few years, there has been considerable interest in general purpose computational models of parallel computation to enable independent development of hardware and software. The BSP and related models represent an important step in this direction, providing a simple view of a parallel mach

Selection, Routing, and Sorting on the S
โœ Sanguthevar Rajasekaran; David S.L. Wei ๐Ÿ“‚ Article ๐Ÿ“… 1997 ๐Ÿ› Elsevier Science ๐ŸŒ English โš– 270 KB

We consider the problems of selection, routing, and sorting on an n-star graph (with n! nodes), an interconnection network which has been proven to possess many special properties. We identify a tree like subgraph (which we call a "(k, 1, k) chain network") of the star graph which enables us to desi