We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06ca190 commit 93ff8a0Copy full SHA for 93ff8a0
searches/floor|CeilUsingBinarySearch.py renamed to searches/floor_or_ceil_using_binary_search.py
@@ -1,4 +1,4 @@
1
-def findFloor(arr, n, x):
+def find_floor(arr, n, x):
2
low = 0
3
high = n - 1
4
ans = -1
@@ -16,7 +16,7 @@ def findFloor(arr, n, x):
16
return ans
17
18
19
-def findCeil(arr, n, x):
+def find_ceil(arr, n, x):
20
21
22
@@ -34,15 +34,15 @@ def findCeil(arr, n, x):
34
35
36
37
-def getFloorAndCeil(arr, n, x):
38
- f = findFloor(arr, n, x)
39
- c = findCeil(arr, n, x)
+def get_floor_and_ceil(arr, n, x):
+ f = find_floor(arr, n, x)
+ c = find_ceil(arr, n, x)
40
return (f, c)
41
42
43
# sample test cas
44
# arr = [3, 4, 4, 7, 8, 10]
45
# n = 6
46
# x = 5
47
-# ans = getFloorAndCeil(arr, n, x)
+# ans = get_floor_and_ceil(arr, n, x)
48
# print("The floor and ceil are:", ans[0], ans[1])
0 commit comments