Hey, I wanted to work on an issue related to binary search. I wanted to add solutions to two questions in JAVA. The questions are as follows.
Question 1.
Given an array, find out how many times it has to been rotated
from its initial sorted position.
Input-Output:
Eg. [11,12,15,18,2,5,6,8]
It has been rotated: 4 times
(One rotation means putting the first element to the end)
Question 2.
Given a SORTED array and an element, find the number of times it occurs in the array. Solve it in O(log N) time complexity
Input-Output:
Eg. [2,4,10,10,10,18,20]
Element: 10
Count: 3
Can I work on this issue?