Analysis of the Multi-Pivot Quicksort Process

In this paper, we study a new version from Dual-pivot Quicksort algorithm when we have some other number k of pivots. Hence, we discuss the idea of picking k pivots 1 2 , , , k i i i  by random way and splitting the list simultaneously according to these. The modified version generalizes these results for multi process. We show that the average number of swaps done by Multi-pivot Quicksort process and we present a special case. Moreover, we obtain a relationship between the average number of swaps of Multi-pivot Quicksort and Stirling numbers of the first kind.


Introduction
Quicksort studied in many books such as [1] [2] and [3]. It is an exhaustively anatomize sorting algorithm and following the idea of divide-and-conquer on an input consisting of n items [4]. Quicksort used a pivot item to divide its input items into two partitions; the items in one sublist seem diminutive or identically tantamount to the pivot; the items in the other sublist seem more sizably voluminous than or equipollent to the pivot, after then it uses recursion to order these sublists. It is prominent that the input consists of n items with different keys in arbitrary order and the pivot is picked by just picking an item, and then on average Quicksort utilizes two pivots 1 p and 2 p such that 1 2 p p < are used, the splitting step sublists the remaining 2 n − items into three sublists, items more minute than or equipollent to 1 p , items between 1 p and 2 p , and items more sizably voluminous than or equipollent to 2 p . Recursion is then applied to the three sublists. It came as a surprise that two pivots should avail, since in his thesis [8] Sedgewick had introduced and explained a Dualpivot technique inferior to classical Quicksort. Hence, Hennequin in his thesis studied the general technique of using 1 k − pivot items [2].
We analyze the limiting distribution of the number of swaps needed by the duality process is proposed. It is known to be the unique fixed point of a certain distributional transformation T with zero mean and finite variance. Depending on the results of [1] and [9], we analyze the Multi-pivot Quicksort when we selected k pivots and we study the relationship with Striling numbers of the first kind.

Multi -Pivot Quicksort
Later, many researchers has received the interest of the visualization of multi-pivot Quicksort in accordance with Yaroslavskiy proposed the duality pivot process which outperforms standard Quicksort by Java JVM. After that, this algorithm has been explained in terms of comparisons and swaps by Wild and Nebel [10].
A normal expansion of duality process would be to have some other number k of pivots. Hence, we cogitation the approximation of pick k pivots 1 2 , , , k i i i  by random way and splitting the list simultaneously according to these. let a random permutation of the list { } 1, 2, , n  be given to be ordered using this variant, with all the ! n substitution. The k rightmost item are picked as pivots are compared to each other and interchange, if they are out of order.
There are n k − items are swaps to the pivots and the list is splitted to 1 k + sublists. The partition step can be worked as follows. We compare the leftmost item to pivot which chosen by random way; if this pivot is bigger than it, it is compared with another pivot which was smaller than the first pivot. Otherwise it is swaped with a bigger pivot (to the right) and after a series of number of swaps are inserted to its place between any two pivots, or to the left of the smallest pivot or to the right of the biggest pivot. We continue with the same technique, until all items are examined.
Each item of the n k − items swaps with the pivots by binary tree, first each item is swaps with the median of the sorted list of the pivots. If it is compared with the first element, otherwise is compared with the third element and after a collection of swaps is inserted to its placement.
For the pervious process, there are k sublists. If we let that the input is a random We assume that 1 k ≥ be an integer. The method " k -pivot quicksort" performs as follows: As long as n k ≤ then sort the input directly. When k n > , order the first k items such that k k k d a n k n k a k a k a a n k refers to the pivots in increasing order, see [11] and [12].
Multiplying both sides by n k multiplying by n z and summing over n ., hence we get the generating function for the average number of swaps [10]. Let ( ) , n n k a E S = and consider the generating func- We find that g z gives the k-th order derivative of ( ).
g z In the right-hand side of Equation (4), the first sum becomes The recurrence becomes as follows In the right -hand side of Equation (5). The first sum becomes in this form because it may be easily explained by mathematical induction that the k-th order derivative of The recurrence is converted to the following differential equation [13]: Multiplying by 1 , the previous Equation (6) is transformed to This differential equation is a Cauchy-Euler equation [14]. We change variables By using the differential operator Θ to solve the previous differential Equation (7) which is defined by So, it is easy to find the relation is satisfied for all values of . k When we apply the operator Θ , our relation seems in the form where ( ) k P Θ is called as the initial polynomial and is given as follows, see [15], with 0 k ≥ , denotes the falling factorial. If we use the fundamental theorem of algebra which proposed that a polynomial of degree n has n complex roots with multiplicities. Notice that −2 is constantly a simple root because, , , , k r r r −  , see [16]. Our polynomial be in the form This differential equation can be written as if we apply k times the solution, we get where i d and i w are constants of integration. Note that ( ) ( ) ( ) The third sum of Equation (15) collects to the solution a stationary contribution.
Furthermore, the root 1 k + when k is even, participates a constant and the root The relation is converted to a k-th order differential equation This differential equation is a Cauchy-Euler equation. We use the deferential operator Θ for the solution of the differential equation. It is defined as follows applying the operator Θ ,our equation becomes is falling factorial, see [18].
is Stirling numbers of the first kind, see [19]. we use the relation

Quicksort
In this section we show the average number of swaps needed by the Quicksort is a particular case form the public case of the multi-pivot Quicksort [20]. For 1 k = where n P give the random variables which counting the number of swaps needed for splitting the list of n items, such that the classical algorithm is applied to an list of n different items [5]. We find that 0

Conclusion
We study a new version from Dual-pivot Quicksort algorithm when we have some other number k of pivots. Hence, we discuss the idea of picking k pivots 1 2 , , , k i i i  by random way and splitting the list simultaneously according to these. Moreover, we derive a generalization of this result for multi process. We show that the average number of swaps done by Multi-pivot Quicksort process and we present a special case. Furthermore, we present the relationship between the average number of swaps of Multi-pivot Quicksort and Stirling numbers of the first kind.