|| BCA || Semter-1 || Linear Search || Binary Search || C in Hindi || Networkers Era || Kanpur ||

Опубликовано: 16 Июль 2026
на канале: Networkersera
59
2

A linear search, also known as a sequential search, is a method of finding an element within a list. It checks each element of the list sequentially until a match is found or the whole list has been searched.

Binary Search

Compare the middle element of the search space with the key.
If the key is found at middle element, the process is terminated.
If the key is not found at middle element, choose which half will be used as the next search space.
If the key is smaller than the middle element, then the left side is used for next search.
If the key is larger than the middle element, then the right side is used for next search.
This process is continued until the key is found or the total search space is exhausted.