Hi all
I started reading 'Introduction to Algorithms' today, but I've gotten a bit confused over one of the exercises.
Exercise 1.2.2 asks the reader
Suppose we are comparing implementations of Merge sort and Insertion Sort on the same machine. For inputs of size n, insertion sort runs in 8n^2 steps, while merge sort runs in 64n log n steps.
For which values of n does insertion sort beat merge sort?
I first tried opening up Wolfram Alpha and using it to draw graphs of the equations, but I couldn't accurately compare the two graphs.
I then tried choosing a random value for n (200), working out the equations on paper, and then modifying the value of n based on my results.
But that took too long.
What is the correct way to solve this exercise?