In Corman, Exercise 1.2-2 asks the following question about comparing insertion sort and merge sort implementations. For inputs of size n, sorting inputs are sorted in 8n ^ 2 steps, and merge sorting is performed in 64 n lg n steps; for which values โโof n insert sort sort sort sort sort?
Although I'm interested in the answer, I'm more interested in how to find the answer step by step (so that I can repeat the process of comparing any two given algorithms, if at all possible).
At first glance, this problem seems similar to what is breaking even in business calculus, a class I took over 5 years ago, but I'm not sure any help would be appreciated.
thanks
P / S If my tags are incorrect, this question is incorrectly classified or any other agreement is used, please limit the punishment to a minimum, as this is my first question.
sorting algorithm time-complexity mergesort insertion-sort
Nate neuhaus
source share