Skip to content

Commit

Permalink
Update 1.BinarySearch.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrezzak authored Oct 19, 2017
1 parent 7bd67cd commit c25065c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions 1.BinarySearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
* and searches the number user enters in the array using
* Binary Search Algorithm
*
* Coded by: Abdurrezak EFE.
* The time complexity is O(nlogn) due to sorting. However, the sorting is just for demonstration of binary search.
* Normally, time complexity of binary search is O(logn)
*
* Coded by: Abdurrezak EFE
*
* */

Expand Down Expand Up @@ -53,4 +56,4 @@ int main()

cout << "The number is in: " << bs(arr, 0, k-1, n) << endl;

}
}

0 comments on commit c25065c

Please sign in to comment.