From 797be1228c7f14e65387474213a94c1df5711a7b Mon Sep 17 00:00:00 2001 From: Anureet Kaur Date: Thu, 7 May 2026 12:36:46 +0530 Subject: [PATCH] Replace generic exception with ValueError in linear search --- searches/linear_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searches/linear_search.py b/searches/linear_search.py index 8adb4a7015f0..b6a5ea89b70b 100644 --- a/searches/linear_search.py +++ b/searches/linear_search.py @@ -55,7 +55,7 @@ def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int: -1 """ if not (0 <= high < len(sequence) and 0 <= low < len(sequence)): - raise Exception("Invalid upper or lower bound!") + raise ValueError("Invalid upper or lower bound!") if high < low: return -1 if sequence[low] == target: