Search arXivSearch

arXiv · 1503.08498

Dual pivot Quicksort

Abstract

In this paper, we analyse the dual pivot Quicksort, a variant of the standard Quicksort algorithm, in which two pivots are used for the partitioning of the array. We are solving recurrences of the expected number of key comparisons and exchanges performed by the algorithm, obtaining the exact and asymptotic total average values contributing to its time complexity. Further, we compute the average number of partitioning stages and the variance of the number of key comparisons. In terms of mean values, dual pivot Quicksort does not appear to be faster than ordinary algorithm.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Vasileios Iliopoulos, David B. Penman. 2015-03-29. Dual pivot Quicksort. https://doi.org/10.1142/s1793830912500413

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

An efficient implementation for solving the all pairs minimax path problem in an undirected dense graph

We provide an efficient $ O(n^2) $ implementation for solving the all pairs minimax path problem or widest path problem in an undirected dense graph. It is a code implementation of the Algorithm 4 (MMJ distance by Calculation and Copy) in a previous paper. The distance matrix is also called the all points path distance (APPD). We conducted experiments to test the implementation and algorithm, compared it with several other algorithms for solving the APPD matrix. Result shows Algorithm 4 works good for solving the widest path or minimax path APPD matrix. It can drastically improve the efficiency for computing the APPD matrix. There are several theoretical outcomes which claim the APPD matrix can be solved accurately in $ O(n^2) $ . However, they are impractical because there is no code implementation of these algorithms. It seems Algorithm 4 is the first algorithm that has an actual code implementation for solving the APPD matrix of minimax path or widest path problem in $ O(n^2) $, in an undirected dense graph.

cs.DS

Approximating Partition in Deterministic Near-Linear Time

We propose a deterministic $\widetilde{O}(n + \frac{1}ε)$-time FPTAS (Fully Polynomial-Time Approximation Scheme) for the classical Partition problem. This is the best possible (up to a polylogarithmic factor) assuming SETH (Strong Exponential Time Hypothesis) [Abboud, Bringmann, Hermelin, and Shabtay'22]. Prior to our work, the best known FPTAS for Partition runs in $\widetilde{O}(n + (\frac{1}ε)^{5/4})$ time [Deng, Jin and Mao'23, Wu and Chen'22]. Our result is obtained by solving a more general problem of weakly approximating Subset Sum.

cs.DS

An FPT algorithm for cycle rank on semi-complete digraphs

Cycle rank is a depth parameter for digraphs introduced by Eggan in 1963. Gruber (DMTCS 2012) and Giannopoulou, Hunter, and Thilikos (DAM 2012) asked whether the problem of determining if a given digraph has cycle rank at most $w$ is fixed-parameter tractable parameterized by $w$. We provide such algorithms for semi-complete digraphs, and for digraphs of bounded directed clique-width. Specifically, we show that given an $n$-vertex semi-complete digraph~$G$ and an integer $w$, one can in time $2^{\mathcal{O}((w+1)4^{w})} n^2$ determine whether $G$ has cycle rank at most~$w$. The proof is reduced to the case of bounded directed clique-width, and we then show that given an $n$-vertex digraph $G$ with a directed clique-width $k$-expression and an integer $w$, one can in time $2^{\mathcal{O}((w+1)4^k)}n$ determine whether $G$ has cycle rank at most $w$. Additionally, we consider the \textsc{Minimum Feedback Arc Set} problem on semi-complete digraphs, and show that it can be solved in time $n^{\mathcal{O}(w)}$, when a cycle rank decomposition of depth $w\ge 1$ is given.

cs.DS