answersLogoWhite

0

How can one perform a binary search?

User Avatar

Anonymous

12y ago
Updated: 8/20/2019

One can perform a binary search easily in many different ways. One can perform a binary search by using an algorithm specifically designed to test the input key value with the value of the middle element.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How can you merge two binary search trees into a single binary search tree?

To merge two binary search trees into a single binary search tree, you can perform an in-order traversal on each tree to extract their elements, combine the elements into a single sorted list, and then construct a new binary search tree from the sorted list. This process ensures that the resulting tree maintains the binary search tree property.


A binary search of an orderd set of elements in an array or a sequential search of the elements.Which one is faster?

A binary search is much faster.


What is the purpose of performing a binary search tree inorder traversal?

Performing a binary search tree inorder traversal helps to visit all nodes in the tree in ascending order, making it easier to search for specific values or perform operations like sorting and printing the elements in a sorted order.


What assumption about the list is made when binary search is conducted?

Binary search requires that the list be in search key order.


What are the advantages and disadvantages of searching in C programming?

If the data is sorted and every element is directly accessible, then you can perform binary search (see built-in function bsearch), otherwise you have to do linear search (which is slower).


What if the elements are repeated in binary search?

You will find one of them (not necessarily the first or the last).


What is the use of binary?

Binary trees are commonly used to implement binary search tree and binary heaps.


What is the binary number for decimal 191?

It is 10111111 in binary. Try a search for '191 to binary'.


Items that are not suitable for a binary search?

The only items suitable for a binary search are those which are in a sorted order.


Does binary tree and binary search tree same?

no they are not same


Are binary search trees always balanced?

No, binary search trees are not always balanced. Balancing a binary search tree involves ensuring that the height difference between the left and right subtrees of each node is at most 1. Unbalanced binary search trees can lead to inefficient search and insertion operations.


Where might one find information about a binary search tree?

One can find information about a binary search tree from a few different places. One can find information at sites such as Wikipedia and You Tube or from taking computer classes that teach about data structures.