We’ve completed a significant upgrade to our video platform!

Still in development

Let us know what you think. We’d love your feedback.

x

Confirm Download

Simultaneous file downloading works best in FireFox, Chrome, and Safari browsers. Please keep this window open until all downloads are complete. Some customers prefer using download managers like GetThemAll Downloader for Chrome or DownThemAll! for Firefox.

Cancel Download

Working with Algorithms in Python

Design Strategies + Effective Data Modeling = Efficient Code

    • BinarySearch

      The online content for Working with Algorithms in Python can be found here

    • 01:41:43

      • Creating a Balanced Binary Search Tree from a Sorted List  (Free)

        Often you need to create a Binary Search Tree containing specific values given to you in sorted order; however, inserting the values into the tree in sorted order would lead to an inefficient structure. In this problem you will learn how to construct a balanced tree from a sorted list.
      • 00:06:22

      • An Informal Introduction to the Analysis of Algorithms

        To evaluate the efficiency of an algorithm, you will learn about the technique of asymptotic analysis. You can analyze the execution and storage requirements using Big O notation. Using a number of examples, this informational presentation on Big O notation will help you better document the performance of your code and understand the descriptions of existing code libraries.
      • 00:38:54

      • MergeSort: A Divide and Conquer Algorithm

        You will learn about the Divide and Conquer strategy used by many efficient algorithms. It divides a problem into two subproblems whose solutions are then composed together to form a solution for the original problem. The MergeSort algorithm is described using this technique and you will see its use on Python lists as well as external files containing binary data.
      • 00:45:32

      • Using MergeSort to Sort External Data

        Most sorting examples assume the input is stored in a list in memory. If you have to process large information on disk, however, it is simply not possible to load the information into memory. You will learn how to apply MergeSort to sort an external file containing integers stored in 32-bit binary format.
      • 00:11:05

      • Mathematical Algorithms: Exponentiation By Squaring

        There are numerous mathematical algorithms you can use to improve the execution performance of your code. You will learn ExponentiationBySquaring, which Python already uses as part of its '**' operator. Here you will learn how to use this algorithm to dramatically improve the performance of using matrix multiplication to compute M^n for a square matrix M. You will learn how to use this algorithm to write a simple probabilistic primality test for very large numbers.
      • 00:37:13

      • Using Exponentiation by Squaring to Determine Whether an Integer Is Prime

        The algorithms in this course are intended to be deterministic, namely, returning the same output when given the same input. A different class of probabilistic algorithms produce answers that are not guaranteed to be correct. They can still be useful, however, and you will learn how to use this approach to design a simple probabilistic algorithm that determines whether a very large number is a prime number; with repeated execution, you can increasingly become confident in the output, but it will never be 100% guaranteed.
      • 00:10:24

      • Using Brute Force to Generate Magic Squares

        A Magic square is an n-by-n two-dimensional matrix of numbers from 1 to n^2 such that the sum of the values in each row, column, and long diagonals are the same. Using the Brute Force approach (with some optimizations), you can write code to generate 4x4 magic squares.
      • 00:16:46

      • KD Trees: Efficient Processing of Two-Dimensional Datasets Part 1

        KD trees are able to represent two-dimensional data sets using a recursive structure based on Binary Trees. Using this data structure, you can write efficient algorithms to find the point in a dataset that is closest to a target query point. You will learn how to write a small graphical application for users to add points and query for the nearest point to the mouse cursor.
      • 00:38:09

      • KD Trees: Efficient Processing of Two-Dimensional Datasets Part 2

        KD trees are able to represent two-dimensional data sets using a recursive structure based on Binary Trees. Using this data structure, you can write efficient algorithms to find the point in a dataset that is closest to a target query point. You will learn how to write a small graphical application for users to add points and query for the nearest point to the mouse cursor.
      • 00:13:45

      • Using KD Trees to Compute Nearest Neighbor Queries

        The KD tree structure lets you rapidly determine whether a point (x,y) is a member of the collection of points in the tree. A Nearest Neighbor Query asks you to find the point in the KD tree which is closest to a target (x,y) point. You will learn how to modify the KD Tree structure and a graphical interface to support the Nearest Neighbor Query.
      • 00:13:56

      • Graph Algorithms: Depth First Search Part 1

        Graphs are a common data structure to represent complicated structured data. Given a graph G of vertices, one often wants to traverse the edges from one vertex to a special destination vertex. Use DepthFirstSearch to search a finite graph to identify a valid path. You will learn about this algorithm in the context of rectangular mazes.
      • 00:26:56

      • Graph Algorithms: Depth First Search Part 2

        Graphs are a common data structure to represent complicated structured data. Given a graph G of vertices, one often wants to traverse the edges from one vertex to a special destination vertex. Use DepthFirstSearch to search a finite graph to identify a valid path. You will learn about this algorithm in the context of rectangular mazes.
      • 00:18:43

      • Graph Algorithms: All Pairs Shortest Path

        Dynamic programming solves complex problems by breaking them down into simpler subproblems. This versatile technique can be used to solve a wide range of problems. You will learn how to compute the shortest path between any two vertices in a weighted, directed graph. You will learn how to represent the All Pairs Shortest Path as a dynamic programming solution.
      • 00:40:48

      • Using Dynamic Programming to Compute Minimum Edit Distance

        Given two strings, s1 and s2, it is possible to compute the Minimum Edit Distance, which determines the number of individual character replacements, insertions, and deletions necessary to convert s1 into s2. This problem is important in the study of mutation in DNA sequences. You will learn how to use Dynamic Programming to solve this problem.
      • 00:08:04

      • The Heap Data Structure and Its Use in HeapSort

        The heap data structure is quite versatile in storing a collection of comparable elements. You will learn how to implement a heap data structure supporting addition and removal of the largest element.
      • 00:26:52

      • Using HeapSort to Sort a Collection

        A heap can be used to efficiently sort a collection of values without requiring any additional storage. You will learn how to implement HeapSort.
      • 00:07:38

      • Single-Source Shortest Path: Using Priority Queues

        Given a graph of vertices and edges, where each edge has a discrete weight, determine a path between two vertices whose total accumulated sum of edge weights along the path is minimal. You will learn the Single-Source Shortest Path and how to use a modified Priority Queue to efficiently solve this problem. The Priority Queue implementation is based on the Heap presented in an earlier module.
      • 00:35:23

      • Using Priority Queues to Compute the Minimum Spanning Tree

        Given an undirected graph with weights associated with each edge, a spanning Tree is a subset of edges from the original graph that ensures the vertices in the graph remain connected even when all other edges are removed. A Minimum Spanning Tree ensures that the sum total of the edge weights is minimal for any potential spanning tree in the graph. You will use the Priority Queue structure to solve this problem.
      • 00:07:10

Working with Algorithms in Python

Design Strategies + Effective Data Modeling = Efficient Code

  • Publisher: O'Reilly Media
  • Released: July 2014
  • Run time: 8 hours 40 minutes

Learn how to make your Python code more efficient by using algorithms to solve a variety of tasks or computational problems. In this video course, you’ll learn algorithm basics and then tackle a series of problems—such as determining the shortest path through a graph and the minimum edit distance between two genomic sequences—using existing algorithms.

Computer scientist George Heineman fully implements each algorithm from scratch in real time, narrating key concepts and steps along the way, and then demonstrates the execution performance of the algorithm implementations on the model problems.

Algorithms are essential to the way computers process data. The examples you’ll learn in this course are among the most common algorithms in computer science, but they illustrate many of the concerns you’ll face as you work to create algorithms on your own. All code is available on GitHub (https://github.com/heineman/python-algorithms).

The topics in this video course include:

  • Just enough mathematical concepts to understand how to analyze algorithms
  • Practical advice to identify code inefficiencies, using algorithm analysis
  • A description of fundamental data structures (such as binary trees, heaps, and graphs) and their use in efficient algorithms
  • Problem-solving strategies, including Divide and Conquer, Dynamic Programming, Greedy, and Brute Force approaches
  • Full implementations of each algorithm in Python within the context of a specific problem
  • A description of the most common algorithmic families, including constant-time, logarithmic time, linear time, polynomial time, and exponential time

George T. Heineman is an Associate Professor of Computer Science at Worcester Polytechnic Institute in Massachusetts.