What is the Big Oh of method2 Is there a best case and a worst case public static void
Chapter 4, Problem 15(choose chapter or problem)
What is the Big Oh of method2? Is there a best case and a worst case? public static void method2(int[] array, int n) { for (int index = 1; index <= n - 1; index++) privateMethod2(array[index], array, 0, index - 1); } // end method2 public static void privateMethod2(int entry, int[] array, int begin, int end) { int index; for (index = end; (index >= begin) && (entry < array[index]); index--) array[index + 1] = array[index]; array[index + 1] = entry; } // end privateMethod2
Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.
Becoming a subscriber
Or look for another answer