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
Now that we have a working implementation of merge sort, let's write some code to make sure the algorithm runs as expected.
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
Let's define a new list at the bottom
that contains several numbers.
0:00
You can put whatever you want in there,
but
0:01
make sure that the numbers
are not in order.
0:04
I will call mine alist.
0:06
And here, we'll say, 54, 26 or
0:10
62, doesn't matter, 93, 17, 77, 31.
0:14
Just add enough so
that you can make out that it's sorted.
0:18
Okay, next we're going to call the
merge_sort algorithm and pass in our list.
0:26
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