int seaLevel(double ar[],int len) { int k=0; int end=len-1; int start=0; while(k==0) { if(start!=end-2) { if(ar[end/2+start/2]>0) { if(ar[(end/2+start/2)+1]<0) { k=end/2+start/2; } start=end/2+(start/2); } else { end=end/2+(start/2); } } else { k=start+1; } } return k; }