Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 15) 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement