Data Structures Flashcards
6 cards from real CodeSignal Technical Assessment practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Data Structures flashcards as text
What is a binary heap used for?
Answer: Efficiently finding the minimum or maximum element and implementing priority queues
Binary heaps maintain a partial ordering that allows O(1) access to the min or max element and O(log n) insertion.
What is the space complexity of a recursive function with depth n?
Answer: O(n) due to the call stack
Each recursive call adds a frame to the call stack, so n levels of recursion use O(n) stack space.
What is a trie data structure?
Answer: A tree-like structure for storing strings where each node represents a character
Tries store strings character by character in a tree structure, enabling efficient prefix-based operations.
What is the time complexity of mergesort?
Answer: O(n log n)
Mergesort divides the array in half recursively (log n levels) and merges at each level (n work per level).
What is dynamic programming?
Answer: Solving complex problems by breaking them into overlapping subproblems and storing their solutions
Dynamic programming avoids redundant computation by storing solutions to subproblems for reuse.
What is a graph traversal?
Answer: Visiting all vertices in a graph systematically, using BFS or DFS
Graph traversal algorithms like BFS and DFS systematically visit all reachable vertices from a starting point.