NextPeer Logo

NextPeer

All Resources

DSA Cheat Sheet

Common structures, complexity assumptions and a problem-solving checklist.

Download editable TXT

Complexities below describe common implementations. State assumptions and check the actual library or implementation.

Structures

Algorithms

Patterns

Solve deliberately

  1. Clarify input, output and constraints.
  2. Work through a small example.
  3. Write a straightforward solution.
  4. Identify the bottleneck.
  5. Improve and justify the change.
  6. Test empty input, boundaries, duplicates and normal cases.
  7. Explain correctness, time and space costs.