Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Algorithms: Sorting and Searching!
You have completed Algorithms: Sorting and Searching!
Preview
Now that we've covered sorting algorithms, the groundwork has been laid to talk about searching algorithms.
See the instruction step following this video for the code!
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
the groundwork has been laid to
talk about searching algorithms.
0:00
If you need to search through
an unsorted list of items,
0:01
binary search isn't an option
because you have no idea which half
0:04
of the list contains
the item you're looking for.
0:08
Your only real option is to
start at the beginning and
0:11
compare each item in the list
to your target value,
0:14
one at a time until you find
the value you're looking for.
0:16
This algorithm is called linear_search or
sequential search,
0:20
because the search proceeds in
a straight line or sequence.
0:24
Even though linear_search is inefficient,
searching for just one name will happen so
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up