All Questions
Tagged with complexity binary-search
8 questions
1
vote
1
answer
126
views
Binary search of 2D matrix
I have written code as below:
...
1
vote
1
answer
377
views
Faster binary search to find the index in Python?
I am implementing a binary search algorithm and my code is as shown bellow:
...
-2
votes
1
answer
197
views
Challenge - Construct binary tree from array [closed]
A coding challenge to construct a binary tree from an array.
...
3
votes
5
answers
365
views
Find the smallest element in a sorted and rotated array [closed]
I was solving a question asked in interview by Uber. It says:
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. Find the minimum element in \$O(\log n)\$ ...
1
vote
1
answer
707
views
Find maximum in sorted and rotated array
This is an interview question.
A sorted rotated array is a sorted array which was rotated 0 or more times.
For example: [1,2,3] -> [2,3,1]
...
2
votes
0
answers
55
views
Find target in sorted array pivoted at some unknown point in O(log n)
You are given an array sorted in ascending order which is rotated at
some pivot unknown to you beforehand. Find your target in \$O(log n)\$
which means it should be a binary search. If the value ...
3
votes
1
answer
292
views
Binary search for IOI problem: Cave
Question
http://www.ioinformatics.org/locations/ioi13/contest/day2/cave/cave.pdf
Code
...
3
votes
5
answers
2k
views
count all array[index] == index occurrences
The method foo gets a sorted list with different numbers as a parameter and returns the count of all the occurrences such that: ...