public class Arrays {
	
	// public static int binarySearch(int[] t, int v, int l, int u){
	//	int m = 0;
	//	while(l <= u){
	//		// m = (l+u)/2;
	//		m = ()
	//		if (t[m] == v) return m;
	//		if (t[m] >	v) u = m -1;
	//		else					 l = m+ 1;
	//	}
	//	return -1;
	// }
	
	static int[] reverse(int[] arr){
		int l			= arr.length;
		int[] rev = new int[l];

		for (int i=l; i > 0; i--) rev[l-i] = arr[i-1];
		return rev;
	}

	static int max(int[] a) {
		int x = 0;
		int y = a.length-1;

		// while (x != y) if (a[x] <= a[y]) x++; else y--;
		while (x < y) if (a[x] <= a[y]) x++; else y--;
		return x;
	}
}

@@ -442,16 +442,37 @@
 %5B%5D a) %7B%0A
+%09%09if(a.length %3E 0)%7B%0A%09
 %09%09int x 
@@ -478,16 +478,17 @@
  = 0;%0A%09%09
+%09
 int y = 
@@ -502,19 +502,17 @@
 h-1;%0A%0A%09%09
-// 
+%09
 while (x
@@ -557,54 +557,22 @@
 ;%0A%09%09
-while (x %3C y) if (a%5Bx%5D %3C= a%5By%5D) x++; else y--;
+%09return x;%0A%09%09%7D
 %0A%09%09r
@@ -577,16 +577,17 @@
 %09return 
-x
+-1
 ;%0A%09%7D%0A%7D%0A

add examples: Arrays.max