Abstract
Sorting is one of the most frequent concerns in Computer Science, various sorting algorithms were invented for specific requirements. As these requirements and capabilities grow, sequential processing becomes inefficient. Therefore, algorithms are being enhanced to run in parallel to achieve better performance. Performing algorithms in parallel differ depending on the degree of multi-threading. This study determines the optimal number of threads to use in parallel merge sort. Furthermore, it provides a comparative analysis of various degrees of multithreading. The implementation in this empirical experiment takes a group of devices with various specifications. For each device, it takes fixed-sized data set and executes merge sort for sequential and parallel algorithms. For each device, the lowest average runtime is used to measure the efficiency of the experiment. In all experiments, single-threaded is more efficient when the data size is less than 105 since it claimed 53% of the lowest runtime than the multithreaded executions. The overall average of the experiments shows either four or eight threads, with 72% and 28%, respectively, are most efficient when data sizes exceed 105.
Highlights
Merge sort is a divide and conquer algorithm that was invented by John von Neumann in 1945, it is an efficient, general-purpose, comparison-based sorting algorithm [1]
Parallel merge sort reduces the complexity to O(nlogn/t), where t is the number of threads, by using multi-threaded operations where the data is divided into equal portions and each portion is assigned to a specific thread
The results proved that parallel merge sort was the fastest, yet the study was comparing only one input size and may differ when the data size increases
Summary
Merge sort is a divide and conquer algorithm that was invented by John von Neumann in 1945, it is an efficient, general-purpose, comparison-based sorting algorithm [1]. Parallel merge sort reduces the complexity to O(nlogn/t), where t is the number of threads, by using multi-threaded operations where the data is divided into equal portions and each portion is assigned to a specific thread. 9: 10: 11: 12: 13: 14: 15: procedure Mergesort var list left ,right , result if length(m) ≤ 1 return m else var middle = length(m) / 2 for each x in m up to middle do add x to left end for for each x in m after middle do add x to right end for left ← mergesort(left) right ← mergesort(right) result ← merge(left, right) return result When it comes to executing algorithms in parallel, most studies show results of the performance on several processors [12,13,14,15].
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
More From: International Journal of Advanced Computer Science and Applications
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.