Computer Science Algorithms

How to make a computer do what you want, elegantly and efficiently.

An algorithm is a step-by-step process to achieve some outcome. When algorithms involve a large amount of input data, complex manipulation, or both, we need to construct clever algorithms that a computer can work through quickly.

By the end of this course, you’ll know methods to measure and compare performance, and you’ll have mastered the fundamental problems in algorithms.

Interactive
quizzes

20

Concepts and
exercises

195+
  1. 1

    Algorithms

    A quick introduction to what an algorithm is and how to measure its performance.

    1. Intro to Computation

      As a computer scientist, you think about how hard it is to come up with the answer, not just about the answer itself.

    2. Using Recursion

      With recursion, you can solve big problems by using solutions to small problems.

    3. Algorithms in the World

      Clever algorithms may be needed for simple tasks, like helping new social network users pick a username.

  2. 2

    Sorting

    A powerful tool for organizing data, from the basic intuition with insertion sort to practical algorithms like Mergesort.

    1. Included with
      Brilliant Premium

      Introduction to Sorting

      Why do computer scientists worry so much about sorting?

    2. Included with
      Brilliant Premium

      Insertion Sort

      Start slow! Insertion sort is a simple and effective way of sorting a small list of numbers.

    3. Included with
      Brilliant Premium

      Mergesort

      What's easier than sorting one big sequence? Creating a sorted sequence from two smaller sorted sequences!

    4. Included with
      Brilliant Premium

      Quicksort

      Quicksort, like Mergesort, uses the divide-and-conquer strategy to quickly sort arrays.

  3. 3

    Graphs

    Algorithms for these useful representations of connections among data.

    1. Included with
      Brilliant Premium

      Introduction to Graphs

      Graphs are a fundamental tool for representing the world around you on a computer.

    2. Included with
      Brilliant Premium

      Trees

      Trees are graphs without cycles, making them much easier to navigate.

    3. Included with
      Brilliant Premium

      Breadth-First Search

      Breadth-first search is a way of finding the shortest connections in a graph.

    4. Included with
      Brilliant Premium

      Minimum Spanning Trees

      Minimum spanning trees help you find the most helpful tree in a complicated graph.

  4. 4

    Strings

    Strings are simple, but the algorithms to analyze them are not!

    1. Included with
      Brilliant Premium

      Introduction to String Algorithms

      Strings are sequences of characters.

    2. Included with
      Brilliant Premium

      Substring Search Algorithms

      Finding one string inside another string is tricker than it first appears!

    3. Included with
      Brilliant Premium

      Deterministic Finite Automaton

      Finite automata are an important tool for writing algorithms on strings.

    4. Included with
      Brilliant Premium

      Knuth-Morris-Pratt Algorithm

      The very best way to search for substrings.

  5. 5

    Dynamic Programming

    Remembering what you already know to solve problems faster.

    1. Included with
      Brilliant Premium

      Dynamic Programming Introduction

      A little memory goes a long way towards solving problems quickly.

    2. Included with
      Brilliant Premium

      Tiling Problem

      How many ways can different tiles decorate a floor? Find out with dynamic programming.

    3. Included with
      Brilliant Premium

      Binary Tree

      The dynamic programming solution to a binary tree puzzle.

    4. Included with
      Brilliant Premium

      Envelopes

      Bring dynamic programming into the second dimension with this envelope fitting puzzle.