From 7ae837018100ddf61ec54659bd25d8bb647bd7a6 Mon Sep 17 00:00:00 2001 From: DigitAll-U <145283820+DigitAll-U@users.noreply.github.com> Date: Wed, 19 Nov 2025 23:42:32 +0500 Subject: [PATCH] Sort email list before binary search For binary search to work correctly proper sorting is needed --- 2-list-algorithms/08_binary_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-list-algorithms/08_binary_search.py b/2-list-algorithms/08_binary_search.py index 96766b3..2bc55fa 100644 --- a/2-list-algorithms/08_binary_search.py +++ b/2-list-algorithms/08_binary_search.py @@ -34,7 +34,7 @@ def binary_search(input_list, target): 'pleasecallmebarney@yahoo.com', 'buffy@sunnydale.edu' ] - +email_list = sorted(email_list) print(binary_search(email_list, 'mgoodyear@lumonindustries.com')) # Output: True print(binary_search(email_list, 'mark.scout@lumonindustries.com')) # Output: False