Link Search Close Search Menu Expand Document

Linear Search

Linear Search is a simple sequential searching algorithms.
It works for any sorted or unsorted array.
It sequentially checks each element in the array if it mathces with the given key.
Search stops if any element matches with the key or if it reaches the end of the array.
It has best case complexity of O(1), average case complexity of O($\frac{n}{2}$) and worst case complexity of O(n).





Back to top

Copyright © 2020-2021 Gajanan Bhat. All rights reserved.