# Linear Search

### Introduction and Summary

The sequential search, also known as the linear search, are the most basic search algorithms and are often the first search method learned in introductory computer science courses.

The basic strategy is straightforward. Every element in the data set is examined in the order presented until the value being searched for is found. If the value being searched for doesn't exist, a flag value is returned (such as -1 for an array or NULL for a linked list).

Sequential search is at best O(1) , at worst O(n) , and on average O(n) . If the data being searched are not sorted, then it is a relatively efficient search. However, if the data being searched are sorted, we can do much better.

## Take a Study Break

### What's your Pretty Little Liars name?

Take this quiz to find out!

### What do teens get when they graduate high school in other countries?

We've got the answers!

### Which young actress just got married?

Click to find out!

### Cat bearding WINS THE INTERNET

Have you seen this yet?

### Scary movies with funny posters

These. Are. Hilarious.

### Geeky Actors: Then and Now

Travel back in time!

### Villains We Want These Actresses to Play

From super cute to super bad!

### 10 Movies Better Than Their Books

What do you think?

### Summer Movie Open Thread

Leave your thoughts here!

### 12 Scientific Inaccuracies in Into Darkness

What did Star Trek get wrong?

## The Book

### Read What You Love, Anywhere You Like

Get Our FREE NOOK Reading Apps