Stack Data Structure

Stack Status

Last Operation: None


Binary Search Tree (BST)


Balanced trees (AVL, weight-balanced) and traversals

The same numbers go into a plain search tree, an AVL tree and a weight-balanced tree, one at a time.

Plain search tree · height 0

AVL tree · height 0

Weight-balanced tree · height 0

small number = nodes in the subtree

Traversals of the AVL tree


    Queue, linked list and LRU cache

    Queue (first in, first out)

    Added at the back, taken from the front.

    Linked list

    Every node points to the next.

    LRU cache (room for 4)

    Every use moves a key first; when it is full, the least recently used goes.

    most recentleast recent