CPSC 241 Name: ___________________________ Homework #1 Due July 12, 2000 For each of the following, determine the order of complexity. Explain fully how you arrived at your answer. Your answer should be one of the following: O(1) O(log n) O(n) O(n^2) O(n log n) O(n^3) O(n!) O(2^n) followed by your explanation. O(?) ______ 1. Finding the sum of a sorted list of n integers, counting additions. ______ 2. Finding the maximum value in a sorted list of n integers, counting comparisons. ______ 3. Bubble sort on a list of n values, counting comparisons ______ 4. Binary search on a list of n sorted values, counting comparisons ______ 5. Matrix multiplication on two (n x n) matrices, counting arithmetic operations ______ 6. Printing all of the values that can be represented by in an n-bit register, counting print statements. ______ 7. Printing all of the permutations of n values, counting print statements. ______ 8. What is the complexity of the following loop, counting print statements? for(int i=0; i