34.5 Exercises
Factual
Which of the following function(s) have the slowest order of growth in terms of Big Theta?
To solve puppy, cat, dog for 12 items, what is the theoretical minimum number of comparisons we have to make, based on the argument used in lecture? Please round your answer up to the nearest whole number.
Which of the following statements are true?
Problem 1
In lecture, we proved that logN!∈Θ(NlogN). Thus, both NlogN and logN! have the same order of growth, and are slower than N2 or N!logN!.
Metacognitive
Suppose we add a new method to
Arrays.sortthat takes in an array of strings. What algorithm shouldArrays.sort(String[] x)use?