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 Introduction to Data Structures!
You have completed Introduction to Data Structures!
Preview
In this video we're going to look at how the remaining data structure operations work on arrays
This video doesn't have any notes.
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
In this video we're going to look at how
the remaining data structure operations
0:00
work on arrays.
0:01
If you took the Introduction to Algorithms
course, we spent time learning about two
0:02
search algorithms,
linear search and binary search.
0:07
While arrays are really fast at accessing
values, they're pretty bad at searching.
0:10
Taking an array, as is, the best
we can do is use linear search for
0:16
a worst case linear run time.
0:20
Linear search works by accessing and
0:22
reading each value in the list until
the element in concern is found.
0:24
If the element we're looking for
is at the end of the list,
0:29
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