Stores things in order. Has quick lookups by index.
An array that automatically grows as you add more items.
Also stores things in order. Faster insertions and deletions than arrays, but slower lookups (you have to "walk down" the whole list).
Like the line outside a busy restaurant. "First come, first served."
Like a stack of dirty plates in the sink. The first one you take off the top is the last one you put down.
Like an array, except instead of indices you can set arbitrary keys for each value.
Good for storing hierarchies. Each node can have "child" nodes.
Binary Search Tree
Everything in the left subtree is smaller than the current node, everything in the right subtree is larger. lookups, but only if the tree is balanced!
Good for storing networks, geography, social relationships, etc.
Stores a set of strings in a big tree of characters. Good for lookups by prefix. Sometimes saves space.
A binary tree where the smallest value is always at the top. Use it to implement a priority queue.
A queue where items are ordered by priority.
A constant-space bitmap that lets you quickly check whether or not an item is in a set. Can give false positives.
Lets you quickly identify which item hasn't been used for the longest amount of time.
Get the 7-day crash course!
In this free email course, I'll teach you the right way of thinking for breaking down tricky algorithmic coding questions.
No CS degree necessary.