Linear Search vs Binary Search

Linear Search

As a beginner programmer, conducting a linear search on an array is conceptually simple and straight-forward to implement. Let’s take a look at an arbitrary example code below. The code is written in Ruby, but the concept of a linear search is language-agnostic.