May 2017
Intermediate to advanced
310 pages
8h 5m
English
In the case where the elements of a list have been already sorted, our search algorithm can be improved. Assuming the elements have been sorted in ascending order, the search operation can take advantage of the ordered nature of the list to make search more efficient.
The algorithm is reduced to the following steps:
In the process of iterating through the list, if the search term is greater than the current item, then there is no need to continue with the search.
When the search operation starts and the first element is compared with (5), no match is made. But because ...