Skip to content

Commit 93ff8a0

Browse files
authored
floor_or_ceil_using_binary_search.py
1 parent 06ca190 commit 93ff8a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

searches/floor|CeilUsingBinarySearch.py renamed to searches/floor_or_ceil_using_binary_search.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def findFloor(arr, n, x):
1+
def find_floor(arr, n, x):
22
low = 0
33
high = n - 1
44
ans = -1
@@ -16,7 +16,7 @@ def findFloor(arr, n, x):
1616
return ans
1717

1818

19-
def findCeil(arr, n, x):
19+
def find_ceil(arr, n, x):
2020
low = 0
2121
high = n - 1
2222
ans = -1
@@ -34,15 +34,15 @@ def findCeil(arr, n, x):
3434
return ans
3535

3636

37-
def getFloorAndCeil(arr, n, x):
38-
f = findFloor(arr, n, x)
39-
c = findCeil(arr, n, x)
37+
def get_floor_and_ceil(arr, n, x):
38+
f = find_floor(arr, n, x)
39+
c = find_ceil(arr, n, x)
4040
return (f, c)
4141

4242

4343
# sample test cas
4444
# arr = [3, 4, 4, 7, 8, 10]
4545
# n = 6
4646
# x = 5
47-
# ans = getFloorAndCeil(arr, n, x)
47+
# ans = get_floor_and_ceil(arr, n, x)
4848
# print("The floor and ceil are:", ans[0], ans[1])

0 commit comments

Comments
 (0)