From c06ad954f0db53c2b9d07cb67c1f109df96db7a5 Mon Sep 17 00:00:00 2001 From: Mahmoud Hamdy Date: Sat, 7 Dec 2024 15:45:03 +0200 Subject: [PATCH] Update 01_binary_search.cpp (#271) 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 f0e06e5..b56f945 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;