Abstract

In the present work, a certain modified version of quicksort, Quicksort_wmb [1], has been taken into consideration. The authors of this new algorithm have claimed that the worst-case complexity of this algorithm is θ(nlogn) which is, in fact, the best-case time complexity for ordinary quicksort. The author has also given examples of its application on some random arrays. Our aim is to study the performance of Quicksort_wmb on input elements drawn from various continuous and discrete probability distributions. The performance is measured in terms of the number of comparisons the algorithm makes to sort the whole array. Here, we have assumed that comparisons are the dominant computer operations, i.e., the most time-taking and therefore performance determining operation in the algorithm. A number of common probability distributions—both continuous and discrete—were simulated to constitute the elements of a random unsorted list of numbers. Next, the aforementioned modified version of quicksort was applied on these arrays to sort the numbers. The number of comparisons required to sort the list of numbers was recorded for each distribution. The results obtained were very interesting. The continuous distributions were sorted faster than the discrete ones by the algorithm, the reason for which, after further investigation, was found to be the existence of ties in discrete distributions, thus providing evidence that this modified version of quicksort is sensitive to ties. The sensitivity of quicksort to ties is not new. What is interesting is that the sensitivity to ties remains irrespective of the improvement.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call