Skip to content

Commit

Permalink
Added docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
manikTharaka committed Oct 4, 2017
1 parent e8e4269 commit 3ba2555
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion search/binary_search/scala/binary_search.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@



/**
* Recursive binary search algorithm
* @param lst the integer array which is being searched
* @param l lower value for partition
* @param r upper value for partition
* @param num number which is being searched for
* @return the index of the element that matches the search term, returns -1 if not found
*/
def binary_search(lst:Array[Int],l:Int,r:Int,num:Int):Int={

if(l <= r){
Expand Down

0 comments on commit 3ba2555

Please sign in to comment.