Top "Binary-search" questions

Binary search is an efficient algorithm for finding an element in a sorted array.

Optimum way to compare strings in JavaScript?

I am trying to optimize a function which does binary search of strings in JavaScript. Binary search requires you to …

javascript string optimization comparison binary-search
how to calculate binary search complexity

I heard somebody say that since binary search halves the input required to search hence it is log(n) algorithm. …

algorithm search time-complexity binary-search
Binary search (bisection) in Python

Is there a library function that performs binary search on a list/tuple and return the position of the item …

python binary-search bisection
Find kth smallest element in a binary search tree in Optimum way

I need to find the kth smallest element in the binary search tree without using any static/global variable. How …

algorithm data-structures binary-tree binary-search
Binary search algorithm in python

I am trying to implement the binary search in python and have written it as follows. However, I can't make …

python algorithm binary-search
How to find the kth smallest element in the union of two sorted arrays?

This is a homework question. They say it takes O(logN + logM) where N and M are the arrays lengths. …

arrays algorithm binary-search divide-and-conquer
Binary Search in Javascript

I'm trying to implement a binary search algorithm in JavaScript. Things seem okay, but my return statements appear to be …

javascript binary-search
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', …

list python-3.x binary-search typeerror
Binary Search Tree Implementation in C++ STL?

Do you know, please, if C++ STL contains a Binary Search Tree (BST) implementation, or if I should construct my …

c++ binary-tree binary-search