Category "binary-search"

Binary search program cause runtime error and failed hidden test cases

I am practicing binary search with problem 704 on leetcode. At first, I just follow the concept of binary search and came up with this solution: int search(int*

Java Heap Space error while writing a program for Square root of an Integer

I am trying to find out the square root of an integer, but in case the integer value is too large for instance - 2147395599. Then the following program gives th

Sorting Arrays Before binary search will Take big O (n)?

When i was learning about Big O Notations , while getting to know the binary search algorithm as it requires sorting the array before searching . I had a questi

TypeError: list indices must be integers, not float

I have a python 3.x program that is producing an error: def main(): names = ['Ava Fischer', 'Bob White', 'Chris Rich', 'Danielle Porter', 'Gor