From 62782aa0394e7e42335d2e97e03c06eac235b2d1 Mon Sep 17 00:00:00 2001 From: Mahmoud Hamdy Date: Mon, 11 Sep 2023 14:06:42 +0300 Subject: [PATCH] Update 01_binary_search.cpp use template to the item that we are search for --- 01_introduction_to_algorithms/c++11/01_binary_search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01_introduction_to_algorithms/c++11/01_binary_search.cpp b/01_introduction_to_algorithms/c++11/01_binary_search.cpp index f0e06e51..b56f945f 100644 --- a/01_introduction_to_algorithms/c++11/01_binary_search.cpp +++ b/01_introduction_to_algorithms/c++11/01_binary_search.cpp @@ -5,7 +5,7 @@ using std::cout; using std::endl; template -int binary_search(const std::vector& list, const int& item) { +int binary_search(const std::vector& list, const T& item) { int low = 0; int high = list.size() - 1;