AlgoBazaAlgoBaza
Back to algorithms

Linear Search

The simplest way to search: we check the elements one by one, from the first, until we hit the target or run out of array. Works on any array โ€” sorted or not.

Podstawowy
O(n)O(1)BOBRALEMOZGIINSTALOGIKOIJ

๐Ÿ”Ž Linear Search โ€” Games

Play both games to master the algorithm!

๐Ÿ’ก

Tip: Start with Game 1 โ€” the lockers show why we search in order and when you may say "not here". In Game 2 you run the code step by step yourself, exactly like tracing code on paper in a contest.