Executes the binary search algorithm with a randomly generated list. Time Complexity: O(log n)
()
| 28 | |
| 29 | |
| 30 | def main(): |
| 31 | """ |
| 32 | Executes the binary search algorithm with a randomly generated list. |
| 33 | Time Complexity: O(log n) |
| 34 | """ |
| 35 | rand_num_li = generate_random_list() |
| 36 | target = random.randint(1, 50) |
| 37 | index = find_target_in_list(target, rand_num_li) |
| 38 | print(f"List: {rand_num_li}\nTarget: {target}\nIndex: {index}") |
| 39 | |
| 40 | |
| 41 | if __name__ == '__main__': |
no test coverage detected