Question: B has to be logarithmic time algorithm 0.5 An array has each distinct value 3 times contiguously except one value that is exactly 2 times.

B has to be logarithmic time algorithm
0.5 An array has each distinct value 3 times contiguously except one value that is exactly 2 times. For example, 8, 8, 8, 2, 2, 2,0,0,0,3,3,3,7,7,6, 6, 6. Your job is to find the value that occurs two times. 2. Write a linear time algorithm that does the job. Your code should be well-commented and variable names should make sense. b. Write a logarithmic time algorithm that does the job. You can write your code recursively or iteratively. Your code should be well-commented and variable names should make sense
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
