A1.3 Smart Algorithms

Learning Objectives: 
To understand how you can split algorithms into smaller parts to find solutions more quickly.


What's it all about?
Information is much easier to find in a sorted list. Telephone directories, dictionaries and book indexes all use alphabetical order, and life would be far more difficult if they didn't. 

Computers spend a lot of their time sorting things into order, so computer scientists have to find fast and efficient ways of writing algorithms so this can happen. One way to speed things up is to break a job up into pieces (decomposition).

Today you are going to explore this idea through a number of activities:

ACTIVITY 1
1. How quickly can you sort the letters of the alphabet on your own?
2. Now find a partner - how quickly can you sort the letters of the alphabet when working with a partner?
3. What algorithms did you use to help you complete this task?




ACTIVITY 2
This activity is a little more challenging!
1. How quickly you can sort out a deck of cards? You can either do this activity in real life with an actual deck of cards or you can use the online deck of cards. 

2. Once you have completed the activity by yourself, you will need to work with a partner to see if you can complete the task more efficiently when working on the task simultaneously. You can either work together side-by-side or click here to access the multi-player links.

















EXTENSION TASK
This next task requires some serious thinking skills! The problem is that all the bottles look the same, but each bottle weighs a different amount. Somehow you have to put the weights in order of size, using the balance scales to help you. What is the quickest method you can find for sorting these weights? (NB The heaviest weight goes to the right, the lightest weight goes to the left.)














Click on the links below to view the YouTube videos that will show you how to complete this task using two different methods. Which is the most efficient?

The Bubble Sort Method

The Quicksort Method

See CS Unplugged for an unplugged version of this activity.

https://www.youtube.com/watch?time_continue=37&v=mUXo-S7gzds&feature=emb_logo