Flashcards · Data Structures · Free
Data Structures flashcards, generated for you.
Example Data Structures study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example Data Structures flashcards
What is a data structure?
An organized way to store and manage data in memory that enables efficient access, modification, and retrieval operations based on algorithms and use cases.
What are the two main complexity dimensions interviewers care about?
Time complexity (how fast operations run) and space complexity (how much memory is used). Trade-offs between them are critical—faster access often requires more memory.
Array: What are the key trade-offs?
Pros: O(1) random access by index, cache-friendly, simple. Cons: O(n) insertion/deletion (middle), fixed size (static arrays), wasteful if sparse.
Linked List: When should you actually use one in an interview?
When you need O(1) insertions/deletions at known positions and don't need random access. Avoid if you need fast lookups; O(n) access is expensive and no cache locality.
Hash Table: What causes performance to degrade and how is it handled?
Collisions (when hash(key1) == hash(key2)) degrade performance. Mitigated by chaining (linked lists) or open addressing (probe for empty slots). Resizing maintains load factor ~0.7.
Stack vs. Queue: What's the operational difference?
Stack is LIFO (Last-In-First-Out)—push/pop from same end. Queue is FIFO (First-In-First-Out)—enqueue at tail, dequeue from head. Both O(1) if backed by linked list or circular array.
Binary Search Tree: What invalidates the O(log n) guarantee?
Unbalanced trees (e.g., all nodes in left subtree). Worst case becomes O(n) linear chain. Self-balancing variants (AVL, Red-Black) guarantee O(log n) via rotations.
Heap: What's the trade-off between max/min heap and BST?
Heap: O(1) find min/max, O(log n) insert/delete, weaker ordering (only parent-child relationship). BST: O(log n) find min/max, O(log n) insert/delete, full in-order traversal available.
Graph representation—Adjacency Matrix vs. List: When use each?
Adjacency Matrix: O(1) edge lookup, O(V²) space, good for dense graphs. Adjacency List: O(E) space, O(degree) edge lookup, better for sparse graphs and traversals.
What's the core trade-off all data structures embody?
You cannot optimize all operations simultaneously. Choose based on your access patterns: sacrifice insertion speed for lookup speed (sorted array), sacrifice memory for access time (hash table), or accept worst-case variance (BST).
Make your own Data Structures study set
Flashcards for related topics
Studying Data Structures to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →