What It Does?
Sorting Example
Advantages & Disadvantages
Binary Search Basics
100

This sorting algorithm repeatedly selects the smallest (or largest) element from the unsorted portion and swaps it with the first unsorted element.

What is Selection Sort?

100

The first array we start with is [6, 3, 8, 5, 2]. The smallest number is this.


What is 2?

100

One reason selection sort is good for beginners is that it’s easy to ___.

What is understand or learn?

100

Binary search only works on this type of array.

What is a sorted array?

200

The time complexity of selection sort is this.  

What is O(n²)?

200

After swapping 2 with 6, the array becomes this.

[6, 3, 8, 5, 2]


What is [2, 3, 8, 5, 6]?

200

Selection sort only needs a small, constant amount of this.

What is memory space?

200

Binary search starts by checking this element.

What is the middle element?

300

The two parts of the array during selection sort are called this and this.

What is sorted and unsorted portion?

300

The next smallest number is already in the right spot. That number is ___.  

[6, 3, 8, 5, 2]

What is 3?

300

It doesn’t make many of these, which is useful when writing to memory is costly.

What are swaps?

300

If the target number is smaller than the middle, the search continues in this half.

What is the left half?

400

Selection sort is known for using very little of this computer resource.

What is memory?

400

The number swapped with 8 in the third step is this.

[6, 3, 8, 5, 2]

What is 5?

400

A big downside is that it’s too slow for this kind of dataset.

What are large datasets?

400

Binary search keeps doing this to the search range.

What is dividing it in half?

500

Even if the list is already sorted, Selection Sort still goes through every comparison. This makes its performance always the same, no matter what.

What is having a fixed number of comparisons (n × (n − 1) / 2) or predictable performance?

500

The final sorted array looks like this.

[6, 3, 8, 5, 2]

What is [2, 3, 5, 6, 8]?

500

The number of comparisons it always makes is about this formula.

What is n × (n - 1) / 2?

500

Binary search is much faster than linear search, with this time complexity.

What is O(log N)?

M
e
n
u