What is search algorithm in data structure? tccicomputercoaching.com
- May 22, 2019
- Posted by: Riddhi Dhandha
- Category: Data Structure at TCCI
What is Search?
Search is a process of finding a value in a list of values. In other words, searching is the process of locating given value position in a list of values.
Linear Search Algorithm (Sequential Search Algorithm)
Linear search algorithm finds given element in a list of elements with O(n) time complexity where n is total number of elements in the list. This search process starts comparing of search element with the first element in the list. If both are matching then results with element found otherwise search element is compared with next element in the list. If both are matched, then the result is “element found”. Otherwise, repeat the same with the next element in the list until search element is compared with last element in the list, if that last element also doesn’t match, then the result is “Element not found in the list”. That means, the search element is compared with element by element
in the list.
To join course at TCCI.
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/