In this case, Merge sort is the faster of the three with time complexity O(nlogn). Time complexity (the estimated time taken by running an algorithm) is measured by how many operations are executed so yes, the number of elements will matter, but not as much as the order of the elements:
Worst-case time complexity (input elements in reversed order)
Best-case time complexity (already sorted)
Average-case time complexity (elements in random order)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello guy ! Nice post !
What is the faster sort algorithm ? Is it depends of number of elements ?
Thanks for reading!
In this case, Merge sort is the faster of the three with time complexity O(nlogn). Time complexity (the estimated time taken by running an algorithm) is measured by how many operations are executed so yes, the number of elements will matter, but not as much as the order of the elements: