A Gentle Introduction to Linked Lists

This software is used to demonstrate the concept of a linked list. Each "node" of the linked list is represented by two consecutive cells of memory, where the first cell is the "data" and the second cell is a "pointer" to the next node in the list, represented explicitly as an index of the cell of memory containing the next piece of data. The address of the head of the list must be specified explicitly. Any node which contains an "illegal" pointer to the next item (e.g., "-1") is assumed to denote the end of the list.

You can modify the contents of the memory cell in whatever way you'd like to experiement. As you change the contents of memory, modified cells will be highlighted in red. The software intentionally leaves the corresponding figure unchanged until you explicitly click on the "Compute and Draw" button.

For a demonstration, you can either create your own list from scratch or you can click on "Randomize Memory" to get you going. Don't forget to click on "Compute and Draw" to see a picture of the underlying linked list

Credits: This software was originally designed as a Java applet by Michael Goldwasser (see original version), and described as a poster at SIGCSE 2003 (detailed description). I also have some brief lecture notes on this topic.

The current version of this software was implemented in 2014 by Nick Lewchenko using Haskell with the JQuery and Canvas libraries from the GHCJS project as well as the Reactive-banana library. The source code for the project is hosted at https://github.com/RoboNickBot/linked-list-web-demo.