Skip to content

Commit

Permalink
Add binary search.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpdedeus committed Apr 20, 2020
1 parent 00368ab commit 25a98ce
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.idea/
*.iml
.vscode
__pycache__
*pyc
*.ipynb_checkpoints
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# PythonFundamentals.Exercises.Algos
# PythonFundamentals.Exercises.Algos

## Binary Search

1. Open module search.py.
2. Fill in the function "binary_search".
3. Make sure to include unit tests in test_search.py.

9 changes: 9 additions & 0 deletions search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import List, Optional
import logging


def binary_search(list_in: List[int], item: int) -> Optional[int]:
"""
If item exists in list_in, this function returns its position in the list.
"""
pass
12 changes: 12 additions & 0 deletions test_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import unittest
import search
import logging

logging.basicConfig(level=logging.INFO)


class SearchTest(unittest.TestCase):

def test_binary_search(self):
pass

0 comments on commit 25a98ce

Please sign in to comment.