You will implement several variations of the binary search algorithm.
Learning Objectives:
- understand the binary search algorithm
- practice recursion
Complete the following tasks:
- Fork the binary_search repo and enable github actions
- Update the
README.md
file so that the test case badges point to your forked repo - Implement the
find_smallest_positive
,count_repeats
, andargmin
functions so that all test cases intests/test_main.py
pass. You must implement each function recursively, and you must ensure that they have logarithmic runtime. (The test cases will not all pass if they do not have logarithmic runtimes.)
Optional:
- You can get 2 points of extra credit if you also implement the
find_boundaries
function so that all test cases in thetests/test_ec.py
file pass. Pseudocode for the function is provided in thebinary_search.py
file.
Submit the link to your forked repository on sakai.