2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by brainfo
0

if i write the no. from 1-10 and when i write 5 for the data to be searched it shows the correct result but except 5 it stucks there with no result.

0

i did it. thanks vidit :)

if(data < a[mid])
      final = mid - 1;
      else
      initial = mid + 1;
      mid=(initial + final) /2 ;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.