Advanced Data Structures Cheat Sheet

These are the heap, deque, tree, and graph operations you'll use most in interviews. We added how fast each one runs.

What's on the sheet

  • Heap. Use a heap when you keep needing the smallest or largest item and don't care about the order of the rest.
  • Deque. Use a deque for a queue or a stack. Adding and removing at either end is O(1).
  • Tree. In a tree, each node points to its children. You visit the nodes one level or one branch at a time.
  • Graph. In a graph, any node can connect to any other node. Remember to build an adjacency list first.

How to get it

This sheet is free. You don't need an account to download the PDF above.

Each coding pattern also has its own sheet. You unlock it by solving that pattern's problems. See the pattern sheets.