Stacks As Linked Lists


I give you these pretty pictures to show how a stack is just a linked list, tilted 90 degrees.

Linked List

Stack

In this way, pre-pending to a list is equivalent to the push operation of a stack, removing Head is equivalent to pop , and getting the value of Head is equivalent to peek.

Related Posts

Handy command line benchmarking tool

Stan Rogers

Ultimate Hot Couch Guy

Quote on Java Generics

The Programmer Tendency

Figure out undocumented JSON with gron

Mental Model of Dental Hygiene

Book Review: Swastika Night

Is there a name for this construction?

Fun with negation and idioms