please tell my anyone which one the best method use for searching. linear, binary etc.
thnxx
Printable View
please tell my anyone which one the best method use for searching. linear, binary etc.
thnxx
It depends. What are you searching? How much data is there to search through?
Re: Which one the best method use for Search..?
Searching is an important function in computer science. As the data sets become larger and larger, good search algorithms will become more important. At one point in the history of computing, sequential search was sufficient. But that quickly changed as the value of computers became apparent.
Linear search has many interesting properties in its own right, but is also a basis for all other search algorithms. Learning its working is critical.
Binary search is the next logical step in searching. Performance can be improved significantly when the data set is very large by using interpolation search, and improved yet again by using binary search when the data set gets smaller.
Searching for data is one of the fundamental fields of computing. Often, the difference between a fast program and a slow one is the use of a good algorithm for the data set.
Binary search is a more efficient search algorithm which relies on the elements in the list being sorted. We apply the same search process to progressively smaller sub-lists of the original list, starting with the whole list and approximately halving the search area every time.