Added JavaDoc to BinarySearch.java

I wanted to see if you would like me to add to your repository with Javadoc.
This commit is contained in:
Zachary Jones
2017-04-16 10:44:08 -07:00
committed by GitHub
parent 86aae08ce6
commit 94871b7e6a

View File

@@ -1,10 +1,23 @@
import java.util.Scanner;
/**
* Implements a Binary Search in Java
*
* @author unknown
*/
class BinarySearch
{
/**
* This method implements the Binary Search
*
* @param array The array to make the binary search
* @param key The number you are looking for
* @param lb The lower bound
* @param up The upper bound
* @return the location of the key
**/
public static int BS(int array[], int key, int lb, int ub)
{
if (lb>ub)
{ if (lb>ub)
{
return -1;
}
@@ -25,6 +38,14 @@ class BinarySearch
}
}
/**
* This is the main method of Binary Search
*
* @author Unknown
* @param args Command line parameters
*/
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
@@ -50,4 +71,4 @@ class BinarySearch
System.out.println("Not found");
}
}
}
}