Searches
Binary Search:- Binary search is a fast search algorithm with their run-time complexity O(log n). For this algorithm to work properly , the collection of data should in the form of sorted. Binary search looks for a specific item by the comparing the middle item of the collection.
For Example:- When you search a word in dictionary , you don’t need to search all the words, you just take one word in the middle and thus narrow down the set of remaining words to check.
Time complexity:- Time complexity simply measure the time that can takes for the function or expression to finished the task, as well as name of the process to measure the time.
Linear Search:- Linear Search is a simple search algorithm with their complexity of O(n). In linear search every item is checked one by one if the match item is found then that specific item is returned, otherwise the search is continued till the end of collection of data.
