Search Algorithm Efficiency

The purpose of the Java applet below is to graphically illustrate the speed advantage of the binary search over the linear search. The applet performs 100,000 linear searches and 100,000 binary searches for randomly selected targets in each of 16 lists (with list sizes ranging from 25 to 400 in increments of 25). The average number of probes required to complete each type of search is calculated for each of the 16 lists. The results are plotted with the list size on the x-axis and the average number of probes on the y-axis.

You may select whether these searches will be successful or not. Whether the search is successful or not greatly affects the performance of the linear search but has no effect on the binary search.

ALT="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." Your browser is ignoring the <APPLET> tag!