Sorted array with duplicates


#1


#2

O(logn) Using binary search algorithm.option A.


#3

OPTION A

THE QUESTION CLEARLY STATES FIND OUT THE NUMBER OF ELEMENTS THAT ARE EQUAL TO A GIVEN KEY ‘K’ WHICH IS EQUAL TO COUNT THE NUMBER OF OCCURRENCES OF AN ELEMENT ‘K’ IN A SORTED ARRAY.
SO,
FOR SOLUTION VISIT THE LINK BELOW: