Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
126 views

Binary search of 2D matrix

I have written code as below: ...
Szyszka947's user avatar
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: ...
Lerner Zhang's user avatar
-2 votes
1 answer
197 views

Challenge - Construct binary tree from array [closed]

A coding challenge to construct a binary tree from an array. ...
Drewsup123's user avatar
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)\$ ...
Vedant's user avatar
  • 49
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] ...
Rodrigo's user avatar
  • 21
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 ...
Rick's user avatar
  • 586
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 ...
QuIcKmAtHs's user avatar
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: ...
user32385's user avatar