Dynamic Sorting Algorithms Implementation using NodeJS
This project implements insertion sort, bubble sort, merge sort and merge sort and displays the total time to execute the sorting.
Allows to dynamic change the compare method, changing the customCompare function. This configuration means that you can compare these sorting algorithms in any object or structure!
Navigate to /project folder and run $ node main
Navigate to /project/configs/arraysToSort.js to change arrays to be sorted Navigate to /project/configs/customCompare.js to change compare function
Sorting array with length=10
insertionSort: 0.480ms
bubbleSort: 0.210ms
mergeSort: 0.308ms
quickSort: 0.353ms
Sorting array with length=10
insertionSort: 0.052ms
bubbleSort: 0.043ms
mergeSort: 0.058ms
quickSort: 0.176ms
Sorting array with length=10
insertionSort: 0.021ms
bubbleSort: 0.021ms
mergeSort: 0.046ms
quickSort: 0.044ms
Sorting array with length=31
insertionSort: 0.851ms
bubbleSort: 0.080ms
mergeSort: 0.137ms
quickSort: 0.114ms
Sorting array with length=20000
insertionSort: 242.413ms
bubbleSort: 2037.736ms
mergeSort: 63.728ms
quickSort: 80.688ms