Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

Mission to Mars

USD 383 STEM Camp - Day 2

Sorting Network

Image Source: CS Unplugged

al-Khwārizmī

Abū ʿAbdallāh Muḥammad ibn Mūsā al-Khwārizmī

Image Source: Wikipedia

Algorithm

A finite list of specific instructions for carrying out a procedure or solving a problem

Euclid

Image Source: Wikipedia

Euclid's Algorithm (GCD)

  1. Start with 2 numbers, A and B
  2. If either one is zero, the answer is the other number
  3. Subtract the smaller number from the larger number
  4. Repeat steps 2 - 4 until an answer is found

Example: GCD of 1071 & 462

Example: GCD of 1071 & 462

Sorting Algorithms

Insertion Sort

Image Source: Wikipedia

  1. Choose an element from the source
  2. Place it in the correct place in the destination
  3. Repeat until source is emtpy

Bubble Sort

Image Source: Wikipedia

  1. Compare the first two elements
  2. If they are out order, swap them
  3. Move one element over and repeat
  4. When the end is reached, start over
  5. Continue until no more swaps are made

Big O Notation

Bubble Sort - Worst Case?

Bubble Sort - Worst Case?

Bubble Sort - Worst Case?

Sorting Algorithms

Merge Sort

Image Source: Wikipedia

Merge Sort

  1. Split the items into two halves
  2. Repeat step 1 until each has 1 item
  3. Choose 2 parts and merge them together by choosing the smallest item repeatedly from the front of each part
  4. Continue merging parts together until no more remain

Quicksort

Image Source: Wikipedia

Quicksort

  1. Choose an item from the list as a "pivot"
  2. Put all items less than that item to its left, and put all items greater to its right
  3. Repeat these steps for the items on each side of the pivot.

Sorting Algorithms

Hydrazine - N2H4

Image Source: Wikipedia

Chemistry