From 94871b7e6a6583884d90004a939da89d5c479429 Mon Sep 17 00:00:00 2001 From: Zachary Jones Date: Sun, 16 Apr 2017 10:44:08 -0700 Subject: [PATCH] Added JavaDoc to BinarySearch.java I wanted to see if you would like me to add to your repository with Javadoc. --- Binary Search.java | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Binary Search.java b/Binary Search.java index a108de7e8..25814197f 100644 --- a/Binary Search.java +++ b/Binary Search.java @@ -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"); } } -} \ No newline at end of file +}