您的位置:首页 > 其它

递归判断数组递增

2015-10-11 00:00 176 查看
public class string {

public static void main(String[] args) {
int []a = new int[]{2,3,4,5,8,1};
System.out.println(fun(a, a.length));
}

private static boolean fun(int[] a, int length) {
if(length == 1)
return true;
else
return fun(a, length - 1) && (a[length -1] > a[length - 2]);

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: