DOI QR코드

DOI QR Code

Analysis and Comparison of Sorting Algorithms (Insertion, Merge, and Heap) Using Java

  • Khaznah, Alhajri (Computer Science Department, College of Science and Humanities Imam Abdulrahman Bin Faisal University) ;
  • Wala, Alsinan (Computer Science Department, College of Science and Humanities Imam Abdulrahman Bin Faisal University) ;
  • Sahar, Almuhaishi (Computer Science Department, College of Science and Humanities Imam Abdulrahman Bin Faisal University) ;
  • Fatimah, Alhmood (Computer Science Department, College of Science and Humanities Imam Abdulrahman Bin Faisal University) ;
  • Narjis, AlJumaia (Computer Science Department, College of Science and Humanities Imam Abdulrahman Bin Faisal University) ;
  • Azza., A.A (Computer Science Department, College of Science and Humanities Imam Abdulrahman Bin Faisal University)
  • Received : 2022.12.05
  • Published : 2022.12.30

Abstract

Sorting is an important data structure in many applications in the real world. Several sorting algorithms are currently in use for searching and other operations. Sorting algorithms rearrange the elements of an array or list based on the elements' comparison operators. The comparison operator is used in the accurate data structure to establish the new order of elements. This report analyzes and compares the time complexity and running time theoretically and experimentally of insertion, merge, and heap sort algorithms. Java language is used by the NetBeans tool to implement the code of the algorithms. The results show that when dealing with sorted elements, insertion sort has a faster running time than merge and heap algorithms. When it comes to dealing with a large number of elements, it is better to use the merge sort. For the number of comparisons for each algorithm, the insertion sort has the highest number of comparisons.

Keywords

References

  1. Microsoft excel spreadsheet software: Microsoft 365. 
  2. Humaira Ali, Haque Nawaz, and Abdullah Maitlo. Performance analysis of heap sort and insertion sort algorithm. International Journal, 9(5), 2021. 
  3. Ayush Arora. Sorting algorithms-properties/pros/cons/comparisons, Dec 2019. 
  4. Marco Benini and Federico Gobbo. Algorithms and their explanations. In Conference on Computability in Europe, pages 32-41. Springer, 2014. 
  5. Ashutosh Bharadwaj and Shailendra Mishra. Comparison of sorting algorithms based on input sequences. International Journal of Computer Applications, 78(14), 2013. 
  6. Miss Pooja K Chhatwani. Insertion sort with its enhancement. International Journal of Computer Science and Mobile Computing, 3(3):801-806, 2014. 
  7. Thomas H Cormen, Charles E Leiserson, Ronald L Rivest, and Clifford Stein. Introduction to algorithms. MIT press, 2022. 
  8. Jehad Hammad. A comparative study between various sorting algorithms. International Journal of Computer Science and Network Security (IJCSNS), 15(3):11, 2015. 
  9. Patrick Keegan, Ludovic Champenois, and Gregory Crawley. NetbeansTM ide field guide, 2006. 
  10. Christos Levcopoulos and Ola Petersson. Adaptive heapsort. Journal of Algorithms, 14(3):395-413, 1993.  https://doi.org/10.1006/jagm.1993.1021
  11. Zbigniew Marszalek. Performance test on triple heap sort algorithm. Technical Sciences/University of Warmia and Mazury in Olsztyn, 2017. 
  12. Smita Paira, Sourabh Chandra, Sk Safikul Alam, and Partha Sarthi Dey. A review report on divide and conquer sorting algorithm. IEEE Kolkata Section, pages 978-993, 2014. 
  13. Russel Schaffer and Robert Sedgewick. The analysis of heapsort. Journal of Algorithms, 15(1):76-100, 1993. https://doi.org/10.1006/jagm.1993.1031