# 3.1 Fundamentals of Algorithms

# Lesson resources

# 3.1.3 Searching algorithms

### Algorithms - Searching and Sorting

CS Field Guide has an extremely comprehensive page about searching and sorting algorithms, including clear explanations, animated examples, and interactives. It covers algorithm efficiency and cost.

*Updated: 2017-01-23*

### Searching game

The Searching Boxes game from the CS Field Guide makes for a good lesson starter and can help students understand the need for different searching algorithms. Once they have tried part 1, students could try Searching Boxes Part 2 and try to devise a better search algorithm.

*Updated: 2017-01-23*

### Linear search / sequential search algorithm

The linear search or sequential search algorithm is very straightforward, but this video explains it. It also makes an important point that students often forget: that is, while we can see all of the numbers on display at the same time in our examples, a computer cannot. Therefore no algorithm can make 'jumps' or 'assumptions' about the data - it must be searched item by item if it is unsorted. The video also includes pseudo code for the algorithm

*Updated: 2017-01-23*

# 3.1.4 Sorting algorithms

### VisuAlgo: Sorting Algorithms

Visu Algo is another site which offers animated visualizations of common computing algorithms. The great thing about their animated sorting algorithms is the ability to display pseudo-code next to the animation and have it run step-by-step, following each line of code as it is processed. Really useful for helping students better understand code.

*Updated: 2015-04-13*

### Sorting Algorithms

As its name suggests, Sorting Algorithms features animations of popular sorting algorithms, including Bubble, Selection, and Insertion. The animations for each sorting method are played side by side, allowing a direct comparison. The great thing about this site is that students can select the state of the starting data (reversed, random, almost sorted, etc) as well as its size - this is perfect for helping students compare the efficiency of the algorithms and understanding that there is no generic "best" algorithm for all circumstances.

*Updated: 2015-04-13*

### Bubble Sort algorithm

This Bubble Sort video does exactly as its name suggests - explaining the algorithm clearing with the aid of diagrams. Although it is labelled as "Java", it is relevant to all computer science students.

There is also a good explanation of the algorithm (including why it is very inefficient) plus step by step diagrams here.

*Updated: 2017-01-23*

### Merge sort algorithm

Harvard's CS50 Merge sort video uses a really clear approach - numbered plastic cups which are moved around as we step through the algorithm. The same approach is used in all of their sorting algorithm videos, making it easy to compare different sorting algorithms.

Joe James' Merge sort algorithm video is also very clear.

For Merge sort in particular, step by step diagrams can be very helpful in understanding the algorithm. TutorialsPoint has a good set of diagrams, plus pseudocode.

*Updated: 2017-01-23*