Abstract

Quick sort is a sorting algorithm whose worst case running time is θ(n2 ) on an input array of n numbers. It is the best practical for sorting because it has the advantage of sorting in place. Problem statement: Behavior of quick sort is complex, we proposed in-place 2m threads parallel heap sort algorithm which had advantage in sorting in place and had better performance than classical sequential quick sort in running time. Approach: The algorithm consisted of several stages, in first stage; it splits input data into two partitions, next stages it did the same partitioning for prior stage which had been spitted until 2 m partitions was reached equal to the number of available processors, finally it used heap sort to sort respectively ordered of non internally sorted partitions in parallel. Results: Results showed the speed of algorithm about double speed of classical Quick sort for a large input size. The number of comparisons needed was reduced significantly. Conclusion: In this study we had been proposed a sorting algorithm that uses less number of comparisons with respect to original quick sort that in turn requires less running time to sort the same input data.

Highlights

  • Sorting is one of the most well studied problems in computer science because it is fundamental in many applications

  • Results showed the speed of algorithm about double speed of classical Quick sort for a large input size

  • We propose PSA Partition and Swap Algorithm, which reduces the time needed for sorting with respect to Quiksort in the worst case

Read more

Summary

Introduction

Sorting is one of the most well studied problems in computer science because it is fundamental in many applications. The worst case running time for Quick sort is O (n2) for an input size n, which is unacceptable for large data sets. We propose PSA Partition and Swap Algorithm, which reduces the time needed for sorting with respect to Quiksort in the worst case. A comparison between Quick sort and PSA algorithm in terms of running time is performed; the simulation results show that PSA is faster than Quick sort in the worst case for sorting the same input data size. The heap is a very fundamental data structure used in many application programs. A heap is a data structure that stores an array in a binary tree maintaining two properties: the first is that the value stored in every node is smaller than or equal to the value of its children.

Objectives
Methods
Conclusion
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