1. Consider the following two functions. What are time complexities of the functions? a) O(2^n) for both fun1() and fun2() b) O(n) for fun1() and O(2^n) for fun2() c) O(2^n) for fun1() and O(n) for fun2() d) O(n) for both fun1() and fun2() 2. Fill in the blank: f(n) = O(g(n)) if and only if g(n) = . 3. To sort a list with n elements, the insertion sort begins with the element. a) First b) Second c) Third d) Fourth 4. List obtained in third pass of selection sort for list 3, 5, 4, 1, 2 is . a) 1, 2, 4, 3, 5 b) 1, 2, 3, 4, 5 c) 1, 5, 4, 3, 2 d) 3, 5, 4, 1, 2 5. The complexity of Bubble sort algorithm is: a) O(n) b) O(log n) c) O(n 2 ) d) O(n log n) 6. The recurrence relation capturing the optimal time of the Tower of Hanoi problem with n discs is: a) T(n)...
a person who writes code for computer programs is real programmer..