Linear Search
Aug 27, 2021
Linear Search is an algorithm used to find an element position in the collection. It compares each element to the searched value consecutively and returns the position when it is found.
Linear search algorithm #
Pseudocode for Linear Search algorithmITERATE over the list s IF s[i] == value THEN return i Found position = i
------ Execution ------ Searched Value: 4 Slice: [3 1 4 2] 4 is located at the position: 2