1. Set beg=-10,last=10
2. REPEAT steps 3 through 6 UNTIL beg>last //INT() is used to extract integer part
3. mid=INT((beg+last)/2)
4. if X[mid]==ITEM then
{ print "Search Successful"
print ITEM,"fount at",mid
break /* go out of the loop*/
}
5. if X[mid]ITEM
beg=mid+1
6. if X[mid]>ITEM then
last=mid-1
/* END of repeat */
7. if beg!=last
print "Unsuccessful Search"
8. END