Skip to content

Commit c06ad95

Browse files
Update 01_binary_search.cpp (egonSchiele#271)
use template to the item that we are search for
1 parent 00b2847 commit c06ad95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

01_introduction_to_algorithms/c++11/01_binary_search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using std::cout;
55
using std::endl;
66

77
template <typename T>
8-
int binary_search(const std::vector<T>& list, const int& item) {
8+
int binary_search(const std::vector<T>& list, const T& item) {
99
int low = 0;
1010
int high = list.size() - 1;
1111

0 commit comments

Comments
 (0)