Computer Science, asked by lam2khorashankitan, 1 year ago

Difference Between Linear Search and Binary Search
What is the difference between linear search and binary search?

Answers

Answered by yasas
1
linear search one item one time without jumping simply o(n)
binary search a sorted list and jump to the nearest of your search simply o(logn)
Answered by AskewTronics
6

Difference Between Linear Search and Binary Search :

Explanation:

  • Linear Search: Linear search is a search in which any element is compared from the all elements present in the list in a sequential manner. For example:- if 5 is needed to search from the list "12,3,2,1", then the 5 will be compared from the 12 first, then it will be compared with 3 and so on.
  • Binary search: The binary search is also a type of search in which firstly the list must be in the sorted order, then the item is searched from the portioned element and if not found then the list is divided into two parts and then the item is searched from the list.
  • For example, if 5 is needed to search from the list "1,2,3,4,5", then the item is compared from the 3 but the 5 is greater and the list is divided into two-part "1,2,3" "4,5", then the item is searched from the greater list and so on.

Learn More :

  • Searching : https://brainly.in/question/4823906
Similar questions