This is Studio 1.
1.Given the un-reduced big-O value, calculate the reduced value.
a. 1
b. n
c. n^2
d. Log n
-
For each of the following algorithms, calculate the big-O value. Be sure to specify which value n refers to. a. Reversing a string n = c b. Printing out a matrix n^2 = (row_idx)(col_idx) c. Reversing each string in an array. n = c
-
Suppose you have an array of Customer objects, sorted in alphabetical order by last name. For each of the following tasks, determine the run time in terms of big-O. a. n b. log(n) c. log(n) d. n^2
-
Now suppose that you have a dictionary (or hash map) of customer objects, where the keys are letters and the values are arrays storing all customers with last name beginning with that letter. a. n b. n c. 1 d. n^2