@@ -164,15 +164,15 @@ def _rank(key: int, the_array: [int], min_index: int, max_index: int) -> int:
164
164
# ---------------------------------------------------------------------------------------------------------
165
165
166
166
167
- def brute_fore_search (key : int , the_array : [int ], index : int ) -> int :
167
+ def brute_force_search (key : int , the_array : [int ], index : int ) -> int :
168
168
"""Returns the index of the key if present, otherwise -1 using brute force search"""
169
169
if index == len (the_array ):
170
170
return - 1
171
171
172
172
if the_array [index ] == key :
173
173
return index
174
174
175
- return brute_fore_search (key , the_array , index + 1 )
175
+ return brute_force_search (key , the_array , index + 1 )
176
176
177
177
178
178
# ---------------------------------------------------------------------------------------------------------
@@ -255,7 +255,7 @@ def main():
255
255
256
256
print ()
257
257
print ("- Brute Force Search: key = 8" )
258
- print (f"index: { brute_fore_search (8 , sorted (test_int_array ), 0 ) } " )
258
+ print (f"index: { brute_force_search (8 , sorted (test_int_array ), 0 ) } " )
259
259
260
260
261
261
# ---------------------------------------------------------------------------------------------------------
0 commit comments