Start with the material you need to learn
Data structures and algorithms is a broad subject, not a single exam with a universal syllabus or format. Your course outline, lecture notes and assigned problems should determine what you study. Check your institution’s current materials before deciding which topics to prioritise.
Collect those materials in one place, then group them into sections. A useful starting map is: complexity analysis, linear structures, hash tables, trees and heaps, graph algorithms, sorting and searching, and dynamic programming. Adjust that map to match your course. For each section, collect definitions, worked examples, implementation details and the kinds of problems your course asks you to solve.
A board in MySummaries for this subject could organise a candidate’s notes like this:
- Big-O describes an asymptotic upper bound; state the variable and operation being counted.
- Binary search on a sorted array takes O(log n) time.
- Nested loops are not automatically O(n²): count how often each loop runs.
- With adjacency lists, BFS and DFS take O(V + E).
- BFS finds shortest paths by number of edges in an unweighted graph.
- Dijkstra’s algorithm requires non-negative edge weights.
- Expected search, insert and delete are O(1) with a well-behaved hash function and controlled load factor.
- Worst-case operations can be O(n) when many keys collide.
- Separate chaining stores colliding entries in a bucket; open addressing probes other slots.
Merge sort is O(n log n) in the usual array implementation and needs O(n) auxiliary space. For dynamic programming, define the state, recurrence, base cases and evaluation order.
| Structure or operation | Typical complexity |
|---|---|
| Balanced BST search, insert, delete | O(log n) |
| Binary heap peek at minimum | O(1) |
| Binary heap insert or remove minimum | O(log n) |
| Build a binary heap from n items | O(n) |
The point of this map is not to memorise a catalogue of complexity values. It is to make the relationship between a structure, its operations and its trade-offs visible. Add examples from your own material, including any conventions your course uses.
Learn each topic in four passes
Use the same process for each section of your course. It prevents a common trap: recognising a solution when reading it, but being unable to produce or explain it independently.
1. Explain the purpose and invariant
Start with the problem the structure or algorithm addresses. Then state what must remain true for it to work. For a binary search tree, for example, each node’s left subtree contains smaller keys and its right subtree larger keys, subject to the duplicate-key convention used by the implementation. For a binary heap, each parent has priority at least as high as its children in a max-heap.
Write the invariant in one or two sentences, then test it against a small example. If you cannot explain why the invariant is preserved after an operation, return to the operation’s steps before memorising its code.
2. Trace small inputs by hand
Choose inputs small enough to follow without skipping steps. Trace indices, pointers, queue contents or table slots after each operation. Include an edge case: an empty structure, one item, duplicate values, a collision, or a graph with a disconnected component.
For an algorithm, record both the changing state and the reason each step is allowed. In BFS, for example, mark a vertex when it is enqueued, not when it is removed from the queue, to avoid adding it repeatedly through different neighbours. Your course may present implementation variants; learn the one in your notes and understand the underlying rule.
3. Implement, then test the boundaries
Write the algorithm from a blank file or editor, in the language your course uses. Keep the first version small and readable. Test ordinary cases, then boundaries and failure cases: empty input, one element, already sorted data, repeated keys, and missing values are useful starting points where relevant.
When a test fails, identify whether the bug is in the algorithm, an index or pointer update, the stopping condition, or an assumption about input. Fix the cause and add a test that would catch the same error next time. Reading a finished implementation is useful for comparison, but it is not a substitute for producing one.
4. State the cost and justify it
Give time and space complexity with the assumptions that make the claim true. For a hash table, distinguish expected from worst-case operation time. For graph traversal, specify the representation when giving O(V + E). For a recursive algorithm, consider the recursion stack as well as any additional storage.
Practise explaining the count: how many times does the loop run, how does the input size change at each recursive call, or how many vertices and edges are processed? An answer with a complexity label but no reasoning is hard to check and easy to misapply.
Keep a short core checklist
After working through your notes and examples, condense the most reusable facts into a small checklist. Use it to identify a gap before a practice problem, not as a replacement for tracing and implementation. Keep course-specific exceptions beside the general rule.
A MySummaries core checklist for this board might look like this:
Check each line against your own course materials. In particular, complexity can depend on the representation, implementation and assumptions. Add a small example beside a fact that you repeatedly confuse—for instance, a graph where BFS and DFS visit vertices in different orders.
Practise retrieval, not just rereading
Once you have attempted an implementation or problem, turn facts you missed into short questions. Ask one thing per card: a condition, an operation cost, an invariant, or a distinction. Answer aloud or in writing before revealing the back. Grade the answer honestly: if you remembered the label but omitted a necessary condition, treat it as a weak answer and revisit it sooner.
A MySummaries card drill for this board could look like this:
What condition does binary search require?
The search range must be ordered according to the comparison being used.
All 7 cards
That is a MySummaries deck, filled with data structures and algorithms material. Yours is written from your own notes. Start free
Work through the cards as questions, not as a list to scan. For each one, try to give the complete answer before checking it. If you miss the reason as well as the value, make that distinction part of your next practice session. Flashcards are best for compact facts; they do not replace solving a full problem or explaining a proof.
Build a weekly practice loop
Set a repeatable schedule that fits your available study time. For example, in a one-hour session, spend 10 minutes recalling the previous topic without notes, 20 minutes tracing or explaining a new idea, 20 minutes implementing or solving a problem, and 10 minutes checking errors and updating your notes. Use longer sessions for problems that need a full design, proof or implementation.
Across a week, rotate the activity rather than doing only one kind of work:
- Session one: learn a topic and write its invariant, operations and assumptions.
- Session two: trace examples, including at least one boundary case.
- Session three: implement the idea and test it from scratch.
- Session four: solve a mixed problem and explain the complexity.
- Review: return to missed questions and earlier topics after a gap.
Keep an error log with the problem, the specific mistake and a rule for preventing it. “Got graph question wrong” is not actionable. “I marked vertices visited when dequeued, so the same vertex entered the queue twice” points to a concrete correction. Reattempt the problem later without looking at the previous solution.
Use an audio recap to revisit a topic
A short spoken explanation can be useful when reviewing a board you have already studied. It should follow the logic of the topic, not simply read out isolated complexity labels. Listen for the assumptions and distinctions, then pause afterwards to reconstruct the algorithm or explain it without the recording.
A MySummaries lecture made from this board could sound like this:
Transcript · tap any word to jump there
Start with the operation your program needs most often. A hash table is a strong fit for key lookup when expected constant-time access is useful, but that claim depends on hashing and the table’s load factor. Collisions still need a resolution strategy, and the worst case can be linear.
A balanced search tree keeps keys in order, which supports ordered traversal and range queries as well as search, insertion and deletion in logarithmic time when the tree remains balanced. A heap solves a different problem: it exposes the highest- or lowest-priority item efficiently, but it is not a structure for finding an arbitrary key quickly.
Before choosing, write down the required operations, ordering needs and cost assumptions. Then test your choice against an awkward case: many collisions, a range query, or repeated removal of the minimum. If you can justify the choice and state what it does not support, you understand more than a memorised complexity table.
After listening, close the notes and compare the structures from memory. Then solve a problem that requires choosing one. If you cannot explain why the alternatives are less suitable, return to the operation requirements and make the comparison yourself.
How MySummaries helps
MySummaries lets you build a revision board from your own data-structures-and-algorithms notes, then use that board for flashcards with spaced repetition and audio recaps. Use it to organise the material you are already studying and revisit facts you have not retained; keep implementing, tracing and solving problems as the central work.