From a142692583207a411657902afda4f20d690eabba Mon Sep 17 00:00:00 2001 From: Ranga sai Date: Sat, 18 Jan 2025 19:16:38 -0500 Subject: [PATCH] precourse 1 --- Exercise_1.py | 15 ++++++++++++--- Exercise_2.py | 21 +++++++++++++++++---- Exercise_3.py | 18 +++++++++++++++--- Exercise_4.py | 33 ++++++++++++++++++++++++++++++--- Exercise_5.py | 26 ++++++++++++++++++++++---- 5 files changed, 96 insertions(+), 17 deletions(-) diff --git a/Exercise_1.py b/Exercise_1.py index 3e6adcf4..4b626253 100644 --- a/Exercise_1.py +++ b/Exercise_1.py @@ -4,7 +4,16 @@ # It returns location of x in given array arr # if present, else returns -1 def binarySearch(arr, l, r, x): - + while lx: + r = mid-1 + elif arr[mid]