Week 7 Learning Objectives

Big-O

  1. Order the common complexity classes according to their growth rate
  1. Identify the complexity classes of common sort methods | Sort Name | Time Complexity | Space Complexity | |:——— |:—————— |:—————– | | bubble | O(__) | O(_) | | selection | O(__) | O(_) | | insertion | O(__) | O(_) | | merge | O(__) | O(_) | | quick | O(__) | O(_) |

  2. Identify complexity classes of code
function example1(n) {
  for (let i = 1; i <= 20; i++) {
    console.log(i);
  }
}

function example2(n) {
  for (let i = 1; i <= n; i++) {
    for (let j = 1; j <= n; j++) {
      console.log(`${i}, ${j}`);
    }
  }
}

function example3(n) {
  console.log(n);
  if (n === 1) return;
  example3(n - 1);
  example3(n - 1);
}

Memoization and Tabulation

  1. Apply memoization to recursive problems to make them less than polynomial time.
function fib(n) {
  if (n === 1 || n === 2) return 1;
  return fib(n - 1) + fib(n - 2);
}

function fibMemo() {}
  1. Apply tabulation to iterative problems to make them less than polynomial time.
function fib(n) {
  if (n === 1 || n === 2) return 1;
  return fib(n - 1) + fib(n - 2);
}

function fibTab() {}

Sorting Algorithms

  1. Explain the complexity of and write a function that performs bubble sort on an array of numbers.
function bubbleSort(array) {

}
  1. Explain the complexity of and write a function that performs selection sort on an array of numbers.
function selectionSort(array) {
  
}
  1. Explain the complexity of and write a function that performs insertion sort on an array of numbers.
function insertionSort(array) {
  
}
  1. Explain the complexity of and write a function that performs merge sort on an array of numbers.
function mergeSort(array) {
  
}
  1. Explain the complexity of and write a function that performs quick sort on an array of numbers.
function quickSort(array) {
  
}
  1. Explain the complexity of and write a function that performs a binary search on a sorted array of numbers.
function bindarySearch(array) {
  
}

Lists, Stacks, and Queues

  1. Explain and implement a Linked List.
  1. Explain and implement a Stack.
  1. Explain and implement a Queue.

GitHub (not going to be on the assessment)

  1. You will be able to participate in the social aspects of GitHub by starring repositories, following other developers, and reviewing your followers

  2. You will be able to use Markdown to write code snippets in your README files

  3. You will craft your GitHub profile and contribute throughout the course by keeping your “gardens green”

  4. You will be able to identify the basics of a good Wiki entries for proposals and minimum viable products

  5. You will be able to identify the basics of a good project README that includes technologies at the top, images, descriptions and code snippets

Format of Assessment