Modify the structure of README.md
Instead of having exercises in their own separate section, they are now part of the main topics sections. This should make the learning process easier to follow where users have both exercises and questions in the same place. In addition, added a couple of new questions & exercises and modified existing scripts accordingly.
This commit is contained in:
@ -2,9 +2,10 @@
|
||||
|
||||
import random
|
||||
|
||||
|
||||
def binary_search(arr, lb, ub, target):
|
||||
"""
|
||||
A Binary Search Example which has O(log n) time complexity.
|
||||
A Binary Search Example which has O(log n) time complexity.
|
||||
"""
|
||||
if lb <= ub:
|
||||
mid = ub + lb // 2
|
||||
@ -17,6 +18,7 @@ def binary_search(arr, lb, ub, target):
|
||||
else:
|
||||
return -1
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
rand_num_li = sorted([random.randint(1, 50) for _ in range(10)])
|
||||
target = random.randint(1, 50)
|
||||
|
Reference in New Issue
Block a user