Searching Note1
Searching Note1
Binary search is more efficient than other searching algorithms that have a similar time
complexity, such as interpolation search or exponential search.
Binary search is relatively simple to implement and easy to understand, making it a good
choice for many applications.
Binary search can be used on both sorted arrays and sorted linked lists, making it a flexible
algorithm.
Binary search is well-suited for searching large datasets that are stored in external memory,
such as on a hard drive or in the cloud.
Binary search can be used as a building block for more complex algorithms, such as those
used in computer graphics and machine learning.
Binary search requires that the array being searched be stored in contiguous memory
locations. This can be a problem if the array is too large to fit in memory, or if the array is
stored on external memory such as a hard drive or in the cloud.
Binary search requires that the elements of the array be comparable, meaning that they must
be able to be ordered. This can be a problem if the elements of the array are not naturally
ordered, or if the ordering is not well-defined.
Binary search can be less efficient than other algorithms, such as hash tables, for searching
very large datasets that do not fit in memory.
Can be used for searching in computer graphics. Binary search can be used as a building
block for more complex algorithms used in computer graphics, such as algorithms for ray
tracing or texture mapping.
Can be used for searching a database. Binary search can be used to efficiently search a
database of records, such as a customer database or a product catalog.
LINEAR SEARCH ALGORITHMS:
Linear search can be used irrespective of whether the array is sorted or not. It
can be used on arrays of any data type.
Linear search can be less efficient than other algorithms, such as hash tables.