http://www.verejava.com/?id=16992676834929
/* Using dichotomy: Find the index position of the given value from an already sequenced array scores: 1. Initialize the lowest bit low=0 first, the highest bit high=scores.length-1 2. Find the median mid= (low+high)/2 value Scores[mid] 3. Compare median scores[mid] to value if the Scores[mid]==value description is found to print the current index of mid, if Scores[mid]<value describes the value to find in mid+1 to H Between IgH if Scores[mid]>value indicates that the value to find is between low and mid-1 4. And so on, the loop performs 3 steps until the value is found or the low>=high termination loop is not found */import Java.util.scanner;public class arraybinarysearch{public STA tic void Main (string[] args) {//define an already ordered fractional array int[] scores={30,40,50,70,85,90,100}; System.out.println ("Please enter the value to look for:"); Scanner in=new Scanner (system.in); int Value=in.nextint (); 1. First initialize the lowest bit low=0, the highest bit high=scores.length-1 int low=0; int high=scores.length-1; int mid=0; Boolean isfind=false; while (Low
http://www.verejava.com/?id=16992676834929
One-dimensional array of Java arrays binary find BinarySearch