In Chapter 4 of Data Structures and Abstractions with Java (Carrano & Henry, 2015, p. 148-149), complete the following:
- Exercise #14
- Exercise #16
- Exercise #18
For each exercise, show your work and all of the steps taken to determine the Big-Oh for each problem. Partial credit cannot be awarded without showing work. Submit all work in a Word document.
Carrano, F. M., & Henry, T. (2015). Data structures and abstractions with Java (4th ed.). Upper Saddle River, NJ: Pearson.
14. What is the Big Oh of methodl? Is there a best case and a worst case?
public static void methodl(int[] array, int n)
{
for (int index = 0; index < n - 1; index++)
{
int mark = privateMethodl(array, index, n 1);
int temp = array[index];
array[index] = array[mark];
array[mark] = temp;
} // end for
} // end methodi
public static int privateMethod1(int[] array, int first, int last)
{
int min = array(first];
int indexOfMin = first;
for (int index = first + 1; index