Write a program which returns the count of a given number in an array using binary search concept. in python code example
Example: binary search in python
def binary_search(group, suspect):
group.sort()
midpoint = len(group)//2
while(True):
if(group[midpoint] == suspect):
return midpoint
if(suspect > group[midpoint]):
group = group[midpoint]
if(suspect < group[midpoint]):
group = group[0: midpoint]
midpoint = (len(group)//2)