edemaine / poketree

PokeTree: Binary Search Trees with Pokémon
https://edemaine.github.io/poketree/
MIT License
5 stars 1 forks source link

PokeTree: BSTs with Pokémon

PokeTree is a web app for visually demonstrating and animating Binary Search Trees (BSTs), AVL trees, and binary heaps.

Try It Out!

Screenshot of PokeTree showing the starting binary tree of Squirtle (7), Pikachu (25), Jigglypuff (39), and Tangela (114), and an input of "add polygon"

Usage

Modes

First, choose your data structure:

Commands

Next, enter commands into the text box in the top left. You can enter one of the following commands:

BST/AVL-only operations:

BST-only operations:

Heap-only operations:

Each key can be an integer or a Pokémon name (up to Generation VIII).

You can also specify multiple keys for one operation, e.g., i 1 2 3 4 or d 1,2,3,4.

Augmentations

You can use the checkboxes to toggle display of two properties next to each node:

Speed

You can also speed up or slow down the animations by dragging the slider.

Credits

Brynmor Chapman wrote the original version of this demo, which used Python, specifically Tkinter's Canvas widget. Erik Demaine added some features and ported the code to the web platform, specifically using Pug, Stylus, and Civet. Both versions were made as teaching aids for the MIT class 6.1210: Introduction to Algorithms.

Thanks to HybridShivam/Pokemon for providing the Pokémon images, based on Bulbapedia.