Hostname: page-component-cd9895bd7-dk4vv Total loading time: 0 Render date: 2024-12-25T17:28:44.132Z Has data issue: false hasContentIssue false

Comparisons in Hoare's Find Algorithm

Published online by Cambridge University Press:  01 March 1998

PETER KIRSCHENHOFER
Affiliation:
Institut für Algebra und Diskrete Mathematik, Technical University of Vienna, Wiedner Hauptstrasse 8-10, A-1040 Vienna, Austria (e-mail: {Peter.Kirschenhofer}{Helmut.Prodinger}@tuwien.ac.at)
HELMUT PRODINGER
Affiliation:
Institut für Algebra und Diskrete Mathematik, Technical University of Vienna, Wiedner Hauptstrasse 8-10, A-1040 Vienna, Austria (e-mail: {Peter.Kirschenhofer}{Helmut.Prodinger}@tuwien.ac.at)

Abstract

We study the number of comparisons in Hoare's Find algorithm. Using trivariate generating functions, we get an explicit expression for the variance of the number of comparisons, if we search for the jth element in a random permutation of n elements. The variance is also asymptotically evaluated under the assumption that j is proportional to n. Similar results for the number of passes (recursive calls) are given, too.

Type
Research Article
Copyright
1998 Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)