2.5H


SUBMITTED BY: Guest

DATE: Sept. 20, 2014, 12:31 p.m.

FORMAT: Text only

SIZE: 365 Bytes

HITS: 791

  1. int k=0;
  2. int end=len-1;
  3. int start=0;
  4. while(k==0)
  5. {
  6. if(start!=end-2)
  7. {
  8. if(ar[end/2+start/2]>0)
  9. {
  10. if(ar[(end/2+start/2)+1]<0)
  11. {
  12. k=end/2+start/2;
  13. }
  14. start=end/2+(start/2);
  15. }
  16. else
  17. {
  18. end=end/2+(start/2);
  19. }
  20. }
  21. else
  22. {
  23. k=start+1;
  24. }
  25. }
  26. return k;

comments powered by Disqus