SUMMARYQuicksort 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.
This document is approved for public release and sale; distribution unlimited. 17. DISTRIBUTION STATEMENT (ol lh» mbrntrmcl wnttfd In Block 30, II illlfmfnt Intn Rmpari) K'-'X')-/>-DHHC/^-^-^-~^3 18. SU9*L«MENTARY NOTES ^L fi/ZrhJ-Sa^'^rnL* tZL-^S 1>. KEY WORDS rConllnu» on fvnmo tldt II nmcttttry mxd IdmnUly by block numbor) abstract data type, correctness proof, data type, data structure, specification, software specification 20. ABSTRACT (Conllnut en nvormo «id« 1/ n^^^ttmry mud Idomlly hy block mmbtt)
The eq~ational,axioms of an algebraic speciflcatlort of a data type (such as flnlte sequences) often can be formed into a convergent sot of rewrite rules; Le. such that all sequences of rewrites are finite and unlque{y termhtatlng, If one adds [
This paper describes algorithms for factoring a polynomial in one or more variables, with integer coefficients, into factors which are irreducible over the integers These algorithms are based on the use of factorIzatmns over finite fields and "Hensel's lemma constructions " "Abstract algorithm" descripttons are used m the presentation of the underlying algebra:c theory Included ~s a new generahzatmn of Hensel's p-adlc constructmn which leads to a practical algorithm for factorlng multivariate polynommls The univarmte case algorithm is also specified m greater deta:l than in the prewous literature, with attentmn to a number of improvements wh:ch the author has developed based OR theoretical computing time analyses and experience with actual implementatmns KEY WORDS AND PHRASI~]S" factorlzation, polynomials, Hensel's lemma, finite fields, modular arithmet:c, Berlekamp's method, abstract algorithms, algorithm correctness, symbohc algebraic computation CR CATEGORIES' 5 24, 5 7
A data abstraction can be naturally specified using algebraic axioms. The virtue of these axioms is that they permit a representation-independent formal specification of a data type. An example is given which shows how to employ algebraic axioms at successive levels of implementation. The major thrust of the paper is twofold. First, it is shown how the use of algebraic axiomatizations can simplify the process of proving the correctness of an implementation of an abstract data type. Second, semi-automatic tools are described which can be used both to automate such proofs of correctness and to derive an immediate implementation from the axioms. This implementation allows for limited testing of programs at design time, before a conventional implementation is accomplished.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.