fork(7) download
  1. class Ideone
  2. {
  3.  
  4. static boolean checkEquals(int a[], int start, int length) {
  5. System.out.println("Called");
  6. if (length==2) {
  7. return a[start]==a[start+1] && a[start]==a[0];
  8. }
  9. else
  10. return checkEquals(a,start+0,length/2) && checkEquals(a,start+length/2,length/2);
  11.  
  12.  
  13. }
  14.  
  15. public static void main (String[] args) throws java.lang.Exception
  16. {
  17. int a[]={1,1,1,1,1,1,1,1};
  18. System.out.println(checkEquals(a,0,8));
  19. }
  20. }
Success #stdin #stdout 0.09s 320320KB
stdin
Standard input is empty
stdout
Called
Called
Called
Called
Called
Called
Called
true