|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSimpleSearcher
public class SimpleSearcher
The SimpleSearcher Java application runs a small test on the
search method that searches for a specified number in an array.
| Constructor Summary | |
|---|---|
SimpleSearcher()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
The main method prints a table of test results, searching for numbers in an array that contains 2, 4, 6, 8, 10, 12, and 14. |
static boolean |
search(double[] data,
double target)
Search an array for a specified number. |
static boolean |
search2(double[] data,
double target)
Search an array for a specified number. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleSearcher()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
String arguments (args) are not used
in this implementation.
public static boolean search(double[] data,
double target)
data - an array of double numberstarget - a particular number that we are searching for
true (to indicate that target occurs
somewhere in the array)
or false (to indicate that target
is not in the array)
public static boolean search2(double[] data,
double target)
data - an array of double numberstarget - a particular number that we are searching for
true (to indicate that target occurs
somewhere in the array)
or false (to indicate that target
is not in the array)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||