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
Let's try our Linear Search and Binary Search scripts out with the `time` command and see how they compare.
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
I've commented out the lines that print
the indexes of matches in the two scripts.
0:00
That way, they'll still cull their
respective search functions with
0:02
the 100 names we're searching for, but
they won't actually print the indexes out.
0:05
So we won't have a bunch of output
obscuring the results of the time command.
0:09
First, let's try the linear search script,
0:13
time python linear_search.py names.
0:17
And we can just use the unsorted
list of names for linear search.
0:22
Remember, we want to ignore the real
result and add the user and
0:28
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