answersLogoWhite

0


Best Answer

In computer science, a binary search or half-interval search algorithm finds the position of a specified value (the input "key") in an array sorted[1][2] into order on the values of the key. At each stage, the algorithm compares the sought key value with the key value of the middle element of the array. If the keys match, then a matching element has been found so its index is returned. Otherwise, if the sought key is less than the middle element's key, then the algorithm repeats its action on the subarray to the left of the middle element or, if the input key is greater, on the subarray to the right. If the array span to be searched is reduced to zero, then the key cannot be found in the array and a special "Not found" indication is returned.

A binary search halves the number of items to check with each iteration, so locating the an item (or determining its absence) takes logarithmic time. A binary search is a dichotomic divide and conquer search algorithm.

Next Answer

A binary search method requires that the list of items being search should be sorted in ascending (or descending) order. If the search list is not sorted, the binary search method will not work and other search methods will be needed.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When is it not recommended to perform the operation of binary search?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can one perform a binary search?

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.


What is the binary search tree worst case time complexity?

Binary search is a log n type of search, because the number of operations required to find an element is proportional to the log base 2 of the number of elements. This is because binary search is a successive halving operation, where each step cuts the number of choices in half. This is a log base 2 sequence.


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 is the use of binary?

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


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 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


What are the drawbacks of the binary search?

The only drawback I know of is that binary search requires that the list already be sorted. So if you have a really large unsorted list than binary search would not be the best option.


How do you print all data in a Binary Search Tree?

By using Depth First Search or Breadth First search Tree traversal algorithm we can print data in Binary search tree.


What is complexity of binary search tree?

The complexity of binary search tree : Search , Insertion and Deletion is O(h) . and the Height can be of O(n) ( if the tree is a skew tree). For Balanced Binary Trees , the Order is O(log n).