Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mikeizbicki/binary_search


https://github.com/mikeizbicki/binary_search

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Binary Search
[![](https://github.com/mikeizbicki/binary_search/workflows/tests/badge.svg)](https://github.com/mikeizbicki/binary_search/actions?query=workflow%3Atests)
[![](https://github.com/mikeizbicki/binary_search/workflows/extra_credit/badge.svg)](https://github.com/mikeizbicki/binary_search/actions?query=workflow%3Atests)

You will implement several variations of the binary search algorithm.

**Learning Objectives:**

1. understand the binary search algorithm
1. practice recursion

## Tasks

Complete the following tasks:

1. Fork the [binary\_search repo](https://github.com/mikeizbicki/binary_search) and enable github actions
1. Update the `README.md` file so that the test case badges point to your forked repo
1. Implement the `find_smallest_positive`, `count_repeats`, and `argmin` functions so that all test cases in `tests/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:

1. You can get 2 points of extra credit if you also implement the `find_boundaries` function so that all test cases in the `tests/test_ec.py` file pass.
Pseudocode for the function is provided in the `binary_search.py` file.

## Submission

Submit the link to your forked repository on sakai.