# A Practical Guide to Algorithms with JavaScript

## Bianca Gandolfo

Thumbtack
4 hours CC

### Course Description

Bored by the academic approach of most data structures and algorithms courses? This is for you! You'll learn to solve algorithms and analyze space and time complexity in both an interview setting and in your day-to-day development. Following along with the course, you'll practice algorithms with common interview questions using a handful of algorithm techniques. Take a practical look at recursion and learn to optimize your solutions using divide-and-conquer. Implement merge sort and quicksort and understand tradeoffs of both approaches. Plus, get started with dynamic programming and memoization!

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

### Course Details

Published: June 5, 2018

## Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
• 200+ In-depth courses
• 18 Learning Paths
• Live Interactive Workshops
Get Unlimited Access Now

### Introduction

Section Duration: 4 minutes
• ### Introducing Practical Guide to Algorithms

00:00:00 - 00:04:55 View Transcript
Bianca Gandolfo introduces herself and talks about why algorithms are essential to all engineers.

### Space & Time Complexity

Section Duration: 41 minutes
• ### Introducing Space & Time Complexity

00:04:56 - 00:20:54 View Transcript
Bianca introduces the concept of time complexity, space complexity, and understanding algorithmic speed. Bianca answers questions from students.
• ### Native Methods & JavaScript

00:20:55 - 00:30:07 View Transcript
Time complexity of Native JavaScript methods and expressions such as property access, loops, and native array methods. Bianca answers questions from students about various methods such as map, reduce, and sort.
• ### Big O Notation

00:30:08 - 00:36:18 View Transcript
Bianca reviews the different big O notations: constant, linear, quadratic, logarithmic, and exponential.
• ### Space Complexity & Review

00:36:19 - 00:39:01 View Transcript
After discussing space complexity, Bianca reviews Big O notations and time complexity.
• ### Big O: Loop

00:39:02 - 00:42:43 View Transcript
Bianca dissects function with a loop to reason about the time complexity.
• ### Big O: Property Lookup

00:42:44 - 00:44:44 View Transcript
Bianca walks through a property lookup in an array.length and measures time complexity.
• ### Big O: Push, Shift, & Unshift

00:44:45 - 00:46:08 View Transcript
Bianca contrasts different array methods and their respective time complexity.

### Optimization with Caching

Section Duration: 57 minutes
• ### Faster Algorithms

00:46:09 - 00:49:40 View Transcript
Bianca reviews two common ways to speed up algorithms through caching previous values significantly.
• ### Unique Sort Exercise

00:49:41 - 00:51:16 View Transcript
In this exercise, students Implement unique sort, which removes duplicates from an array.
• ### Unique Sort Solution

00:51:17 - 01:00:11 View Transcript
Bianca reviews the breadcrumbs caching technique while walking through the unique sort solution.
• ### Caching with Memoization

01:00:12 - 01:05:11 View Transcript
Bianca discusses the difference between memoizing and the breadcrumbs caching technique.
• ### Basic Memoization Exercise

01:05:12 - 01:08:35 View Transcript
In this exercise, students use a global cache to memoize.
• ### Basic Memoization Solution

01:08:36 - 01:14:41 View Transcript
Bianca walks through the Basic Memoization Exercise and answers questions from students.
• ### Memoization with Closure Exercise

01:14:42 - 01:17:09 View Transcript
In this exercise, students improve the memoize function by moving the cache into a closure.
• ### Memoization with Closure Solution

01:17:10 - 01:26:50 View Transcript
Bianca walks through the Memoization with Closure Exercise to show how to use a closure to make the cache local. Bianca answers questions from students.
• ### Generic Memoize Function Exercise

01:26:51 - 01:30:11 View Transcript
In this exercise, students make a memoize function generic by passing in the function rather than hardcoding a function.
• ### Generic Memoize Function Solution

01:30:12 - 01:41:47 View Transcript
Bianca reviews the previous two exercises and walks through how to transform the hardcoded memoize function into a generic memoize function.
• ### Reviewing Optimization

01:41:48 - 01:43:27 View Transcript
Bianca wraps up discussing the different caching techniques by reviewing the trade-off between time complexity and space complexity.

### Recursion

Section Duration: 53 minutes

### Divide & Conquer

Section Duration: 46 minutes
• ### Introducing Divide & Conquer

02:36:39 - 02:40:10 View Transcript
Bianca introduces what divide and conquer method to sorting. After data is separated into smaller lists, the merge step combines two sorted lists into one sorted list.
• ### Linear Search Exercise

02:40:11 - 02:40:51 View Transcript
In this exercise, students implement linear search.
• ### Linear Search Solution

02:40:52 - 02:45:40 View Transcript
Bianca walks through the solution to Linear Search Exercise. Bianca answers questions from students.
• ### Binary Search

02:45:41 - 02:50:17 View Transcript
Bianca illustrates binary search, which allows a search of a sorted array by repeatedly splitting the array in half. Binary search is fast Since with each iteration half of the array is determined to be undesired, instead of just one wrong value.
• ### Divide & Conquer Review

02:50:18 - 02:51:17 View Transcript
Bianca reviews divide and conquer.
• ### Sorting Types

02:51:18 - 02:58:18 View Transcript
Bianca discusses the two main types of sorting: naive and divide & conquer. Bianca answers questions from students.
• ### Merge Sort

02:58:19 - 03:05:32 View Transcript
Bianca reviews merge sort, which is an algorithm that takes a "divide and conquer" approach to sorting. With merge sort, data is separated into smaller lists, the merge step combines two sorted lists into one sorted list.
• ### Merge Sort Walkthrough

03:05:33 - 03:12:02 View Transcript
Bianca walks through a code example of merge sort.
• ### Bubble Sort & Merge Sort Exercise

03:12:03 - 03:13:06 View Transcript
In this exercise, students implement bubble sort and merge sort.
• ### Bubble Sort Solution

03:13:07 - 03:15:35 View Transcript
Bianca walks through the first part of the Bubble Sort & Merge Sort Exercise by coding the solution to bubble sort.
• ### Merge Sort Solution

03:15:36 - 03:23:04 View Transcript
Bianca walks through the last part of the Bubble Sort & Merge Sort Exercise by coding the solution to mergesort. Bianca answers questions from students.

### Greedy Algorithms

Section Duration: 21 minutes
• ### Introducing Greedy

03:23:05 - 03:26:56 View Transcript
Bianca introduces the greedy algorithm, which is an algorithmic paradigm that follows the problem-solving course of making the locally optimal choice.
• ### Greedy Algorithms Walkthrough

03:26:57 - 03:29:38 View Transcript
Bianca walks through a "make change" problem to demonstrate the greedy algorithm.
• ### Brute Force

03:29:39 - 03:44:31 View Transcript
Bianca reviews the brute force approach, which calculates every single combination possible and keeps track of the minimum. Bianca answers questions from students.

### Dynamic Algorithms

Section Duration: 16 minutes
• ### Introducing Dynamic Programming

03:44:32 - 03:52:31 View Transcript
Bianca discusses dynamic programming, which is a data optimization technique. The dynamic approach caches values to avoid repeated calculations. Bianca answers questions from students.
• ### Memoization with Recursion

03:52:32 - 03:54:04 View Transcript
Binca reviews memoization and recursive approach to the "make change" problem.
• ### The Landscape of Data Structures & Algorithms

03:54:05 - 04:00:54 View Transcript
Bianca wraps up "A Practical Guide to Algorithms" course by reviewing the landscape of data structures and algorithms. Bianca answers questions from students.

### Learn Straight from the Experts Who Shape the Modern Web

• In-depth Courses