public class Main { public static void main(String args) { int values = {0, 13, -3, -25, 20, -3, -16, -23, 18, 20, -7, 12, -5, -22, 15, -4, 7}; int low = 1; int high = 16; int mid = (low + high) / 2; int LRMax = new int; LRMax = maxSubarray(values, low, high); System.out.println(LRMax + " " + LRMax + " " +LRMax); } public static int maxSubarray(int values, int low, int high) { //returns LRMax: LRMax -> left and right index of max subarray // and LRMax -> the crossing sub array's sum int LRMax = new int; //If the array contains ; return LRMax; } }
|