Linear search
A linear search is going through a list one after another until the value is found or the end of the list is reached. Including a flag can make this process more efficient as
it allows you to stop searching if you find the value you are looking for. Although the code on the right is longer it would execute more quickly if the search term is near the
start of the list and the list is long. In the code below there is an advantage in execution time even with a short list.