Stack Exchange
open access
CC BY-SA
Quicksort Partitioning: Hoare vs. Lomuto
There are two quicksort partition methods mentioned in Cormen: (the argument A is the array, and [p, r] is the range, inclusive, to perform the partition on. The returned value is the index to the pivot after the partition.) Hoare-Partition(A, p, r) x = A[p] i = p - 1 j = r + 1 while true repeat j = j - 1 until A[j] = x if i < j swap( A[i], A[j] ) else return j and: Lomuto-Partition(A, p, r) x = A[r] i = p - 1 for j = p to r - 1 if A[j] <= x i = i + 1 swap( A[i], A[j] ) swap( A[i + 1], A[r] ) return i + 1 Disregarding the method of choosing the pivot, in what situations is one preferable to the other? I know for instance that Lomuto preforms relatively poorly when there is a high percentage of duplicate values ( i.e. where say more than 2/3rds the array is the same value ), whereas Hoare performs just fine in that situation. What other special cases make one partition method significant better than the other?
Conceptio Open Archive
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
This document is indexed with metadata only: full text is not available in the archive for this record. Open the official source ↗
Related documents
- Prospective Evaluation for Receiving SynFlow 3.0 Interventional Circulatory Support in High-risk PCI: A Randomized Controlled Trial#1074254
- Hierarchical Expansion of Finite Discrete Dynamical Systems: A Non-Archimedean Variational Theory over Coordinate Orderings#998141
- A Phase transition in the distribution of the length of integer partitions#938759
- Performance Evaluation of Fast Fourier Transforms on Emerging RISC-V Hardware with Vector Extension Support#784839
- Performance Evaluation of Fast Fourier Transforms on Emerging RISC-V Hardware with Vector Extension Support#783249
Record · ID 796537
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive