# Algorithm Comparison and Instances ## Prerequisites --- * Asymptotics Notation * Basic Mathematical Concept * Growth of Functions ### Question 1 --- How to compare an insertion sort taking $\ c1*n^2$ time and a merge sort taking $\ c2*nlogn$ time? Which $\ c1$ is much more smaller than $\ c2$.(You can use different methods to prove it) ### Question 2 --- Suppose that computer A executes 10 billion instructions per second and computer B executes 10 million instructions per second. How long will it take to sort 10 million numbers on computer A using an algorithm costing $\ 2*n^2$. And how long will it take to sort 10 million numbers on computer B using an algorithm costing $\ 50*nlog(n)$ ? ### Question 3 --- Use the method of Question1 and Question2 (or you can use any methods), please answer the following question. :::spoiler open the questions 1. $\ O(10000nlog) > O(0.00001 n^2)$ **(True or False)** 2. Compare the following functions and **sort them in ascending growth order**. (a)$\ log(n!)$ (b)$\ 1001^ {log(n)}$ (C )$\ (n-10)!$ (d)$\ n*2^n$ ::: ## Hint --- ![](https://i.imgur.com/EsV6Ftp.jpg) --- ### Answer 1 --- ### Answer 2 --- ### Answer 3 --- >[name=罐子] ###### tags: `Algorithm`