punkerdood / algo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

algo

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

  1. 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

  2. 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

  3. 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

About