homework_6 Version 0 |
|
👤 Author: by 1299654109qqcom 2018-11-25 08:38:09 |
Binary search (binary search) is a very fast search algorithm. This search algorithm is applicable to the principle of splitting and governing. Data collection for the correct operation of the algorithm should be in an orderly form. Binary search searches specific items by comparing the central items of the collection. If a match occurs, the index of the item is returned. If the middle item is larger than the item, then the item is on the right side of the middle item in the search sub-array, otherwise the other items will be searched on the left side of the middle item in the sub-array. This process continues in the subarray until the size of the subarray is reduced to zero. Binary search halves the number of items searched, thus reducing the number of comparisons that must be made to a very small number.