public class UsporiadanePole {
public boolean spravneZoradene( int p[],int i, int j){
System.out.println(i+" , " +j);
if(i==j)
return true;
if(j==i+1)
return p[i]<=p[j];
int stred= (i+j)/2;
if(!spravneZoradene(p, i, stred))
return false;
return spravneZoradene(p, stred, j);
}
public static void main(String[] args) {
UsporiadanePole p = new UsporiadanePole();
p.spravneZoradene(new int[]{1,3,5,8,7,9,14}, 0, 6);
}
}