Visualizing Algorithms and Data Structures

Working with abstract, and complicated concepts like algorithms, and data structures is tricky as it is. We can help ourselves by visualizing these items using various helpful bits of software.

Software Dependencies

The following notebooks use one, or more of the following software packages:

  • Graphviz

    Graphviz is open source graph visualization software. There are many available installers for different platforms. Regardless of platform, you will need to ensure Python bindings are installed, in order to use Graphviz from within Python. I can provide you easy installations for Mac, and Linux.

    Using the Homebrew package manager for Apple macOS:

$ brew install --with-bindings graphviz

Using apt, under Ubuntu:

$ sudo apt-get install graphviz libgv-python
  • rcviz

    The rcviz Python package is dependent on Graphviz. It’s purpose is to visualize recursion. The provided link is a fork of another repository of the same name, but my forked version supports Python 3 and Jupyter.

    To install it, use pip:

    $ pip install git+https://github.com/DamnedFacts/rcviz.git

Creating Your First Python Package

In this course, I want to teach you some content beyond the basic algorithms and data structures. Specifically, some intermediate Python techniques. There are numerous areas of Python programming we could discuss, but one in particularly stands out: packages. Accessory to this, and not specifically related is the use of the Git software for version control, and Github as a popular hosting provider for Git repositories.

This document section can be broken up into two main parts:

Step 1: Learning Git

Read git - the simple guide, or find your own resource.

Remember, Mac and most Linux systems come with Git already installed. You’ll almost certainly need to install it for Windows.

Step 2: Create a Git repository (repo) on Github

Step 5: Install and Use

Installation of your pythonds9 package will be in “editable” mode. It will take your working, local directory for your pythonds9 repository and make links into areas of your system where Python will recognize the existence of your package. Therefore, any chances you make to your package will immediately be available without having to reinstall.

To do this, something like this needs to happen (using your terminal program):

$ cd pythonds9
$ pip3 install --user -e .