---
title: "Stacks As Linked Lists"
canonical: "/2017/04/02/stacks-as-linked-lists/"
date: "2017-04-02"
author: "Alok Singh"
tags: []
---


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

![Linked List](/assets/linked-list.png)

![Stack](/assets/stack.png)

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`.
