Skip to content

Instantly share code, notes, and snippets.

@JoeKarlsson
Forked from jaywon/stack-challenge.md
Last active September 4, 2015 20:19
Show Gist options
  • Save JoeKarlsson/5e88a6a0e6064f88f65c to your computer and use it in GitHub Desktop.
Save JoeKarlsson/5e88a6a0e6064f88f65c to your computer and use it in GitHub Desktop.
Use a Linked List to simulate a stack trace

###Console History Sim Stack Trace Challenge

Using a linked list, we are going to demonstrate a use case for a linked list and simulate a stack like you see in a stack trace that replays the history of what we typed.

  1. Add a text box to an HTML page and a 2 buttons, save and dump.
  2. Every time the user clicks the first button to save, we are going to save the text input to our linked list as the most recent node or head.
  3. Whenever someone clicks the dump button we are going to dump out all of the input they've typed in to that point from most recent to oldest. This should be written as HTML to the page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment