Top "Binary-search" questions

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

How binary search is used in database indexing

I know how binary search works but I wanted to know practical uses for binary search... I searched through the …

database algorithm relational-database binary-search database-indexes
How is it possible to do binary search on a doubly-linked list in O(n) time?

I've heard that it's possible to implement binary search over a doubly-linked list in O(n) time. Accessing a random …

algorithm data-structures big-o binary-search doubly-linked-list
How to perform binary search on NSArray?

What is the simplest way to do a binary search on an (already) sorted NSArray? Some potential ways I have …

objective-c ios algorithm nsarray binary-search
java Arrays.binarySearch fails to find target

String[] sortedArray = new String[]{"Quality", "Name", "Testing", "Package"}; // Search for the word "cat" int index = Arrays.binarySearch(sortedArray, "Quality"); I …

java binary-search
What's the most efficient way to compare two blocks of memory in the D language?

I need a comparison function for blocks of memory for doing binary searches on arrays of bytes in the D …

performance algorithm d binary-search low-level
Which is more efficient, Sorting and then Binary Search over a Collection or Linear Search in java

Suppose I am having a Collection of object: List<String> myList = populateMyArrayList(); //Here I am having an ArrayList …

java collections binary-search mergesort linear-search
How is it possible to do binary search on a singly-linked list in O(n) time?

This earlier question talks about doing binary search over a doubly-linked list in O(n) time. The algorithm in that …

algorithm data-structures linked-list big-o binary-search
Why is there a List<T>.BinarySearch(...)?

I'm looking at List and I see a BinarySearch method with a few overloads, and I can't help wondering if …

c# list collections binary-search
How do I return the index of the target element in a Python array?

Currently, when I search for the element that is at the midpoint it returns the correct index, but for any …

python algorithm binary-search
Fast average without division

I have a binary search loop which gets hit many times in the execution path. A profiler shows that the …

algorithm language-agnostic bit-manipulation binary-search