Consider the sort method shown below for selection sort: pub…

Consider the sort method shown below for selection sort: public static void sort(int[] a) { for (int i = 0; i < a.length – 1; i++) { int minPos = minimumPosition(i); swap(minPos, i); } } Suppose we modify the loop condition to read i < a.length. What would be the result?

Complete the code for the calcPower recursive method shown b…

Complete the code for the calcPower recursive method shown below, which is intended to raise the base number passed into the method to the exponent power passed into the method: public static int calcPower(int baseNum, int exponent) { int answer = 0; ________________________ { answer = 1; } else { answer = baseNum * calcPower (baseNum, exponent – 1); } return answer; }

Complete the code for the calcPower recursive method shown b…

Complete the code for the calcPower recursive method shown below, which is intended to raise the base number passed into the method to the exponent power passed into the method: public static int calcPower(int baseNum, int exponent) { int answer = 0; ________________________ { answer = 1; } else { answer = baseNum * calcPower (baseNum, exponent – 1); } return answer; }