Data Structures Fundamentals
- 106Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
106 questions
- 1A data structure organizes data so that it can be accessed, queried, or updated more_____.
Hint
Think about the main goal of organizing data.
Answer
efficiently
- 2Data structures are essential ingredients in creating fast and powerful_____.
Hint
They help determine how efficiently a computational task can be performed.
Answer
algorithms
- 3An abstract data type specifies a data structure's behavior and methods, but not the details of how those methods are_____.
Hint
The abstraction defines an interface rather than construction details.
Answer
implemented
- 4A dynamic array and a linked list can both implement the abstract data type called a_____.
Hint
This abstract type supports adding, removing, and indexing elements.
Answer
list
- 5Big O notation describes an algorithm's_____-case performance.
Hint
It considers the least favorable arrangement of a given input size.
Answer
worst
- 6In Big O analysis, the variable n usually represents the_____size given to an algorithm.
Hint
It measures how much data the algorithm receives.
Answer
input
- 7When analyzing Big O, constant terms and multiplicative factors are ignored because the analysis focuses on behavior as the input becomes arbitrarily_____.
Hint
Consider what happens as input size tends toward infinity.
Answer
large
- 8For 7log(n)+15n2+2n3+8, the dominant term gives a Big O complexity of_____.
Hint
Compare the growth rates of the terms as n increases.
Answer
O(n3)
- 9Searching an unordered list for a value that may be in the last position takes linear time, written as_____.
Hint
In the worst case, every element must be checked.
Answer
O(n)
- 10Binary search repeatedly discards half of a sorted search range, giving it_____time complexity.
Hint
The number of remaining candidates is roughly halved on each iteration.
Answer
logarithmic
- 11Finding all subsets of a set takes exponential time because a set of n elements has 2n_____.
Hint
Each element can either be included or excluded.
Answer
subsets
- 12Finding all permutations of a string of length n has complexity_____.
Hint
The number of possible orderings is a factorial function.
Answer
O(n!)
- 13Mergesort has time complexity_____.
Hint
Its work combines dividing the input into levels with processing across each level.
Answer
O(nlog(n))
- 14When independent nested loops do work proportional to n and then proportional to n, their combined complexity is_____.
Hint
Multiply the work from the two loop levels.
Answer
O(n2)
- 15When separate blocks of work have complexities O(n) and O(n2), the combined complexity is determined by the_____term.
Hint
The faster-growing contribution controls the asymptotic result.
Answer
dominant
- 16A static array is a fixed-length container whose elements are usually stored in a_____chunk of memory.
Hint
The element addresses are adjacent rather than scattered among gaps.
Answer
contiguous
- 17In a zero-based array of length n, valid indices range from zero through_____.
Hint
The first element has index zero, so the last index is one less than the length.
Answer
n−1
- 18An array is indexable because each slot can be referenced by a_____.
Hint
This numeric position is also called the slot's index.
Answer
number
- 19Because array elements are indexable, accessing an element at a known index takes_____time.
Hint
The access does not require searching through the preceding elements.
Answer
constant
- 20A static array cannot grow or shrink because it has a_____size.
Hint
Its capacity is set when the container is created.
Answer
fixed
- 21When a dynamic array exceeds its capacity, one common strategy is to allocate a larger static array, copy the elements, and_____its capacity.
Hint
The implementation shown expands by a factor of two.
Answer
double
- 22Appending to a dynamic array is usually constant time on an amortized basis because resizing happens_____.
Hint
Most appends do not require allocating and copying a new array.
Answer
rarely
- 23Inserting into the middle of a dynamic array can take linear time because elements may need to be_____.
Hint
Existing elements must make room at the insertion position.
Answer
shifted
- 24A linked list is a sequential list of nodes that hold data and point to other_____.
Hint
The list's connections link one data-containing unit to another.
Answer
nodes
- 25The reference to the first element of a linked list is called its_____.
Hint
Traversal normally begins from this node.
Answer
head
- 26The last element of a linked list is called the_____.
Hint
It is the endpoint opposite the head.
Answer
tail
- 27In a singly linked list, each node contains a pointer to the_____node.
Hint
The list can be traversed forward through this reference.
Answer
next
- 28A doubly linked list differs from a singly linked list by storing a pointer to both the next and the_____node.
Hint
This extra reference enables traversal in the reverse direction.
Answer
previous
- 29A singly linked list saves memory compared with a doubly linked list because each node stores only_____link pointer.
Hint
It does not need an additional pointer to the preceding node.
Answer
one
- 30Removing a known node from the middle of a doubly linked list can take constant time because its previous and next nodes can be linked directly, provided a reference to the node is_____.
Hint
The operation does not need to search for the node first.
Answer
available
- 31Removing the tail from a singly linked list takes linear time because the list must be traversed to find the tail's new_____.
Hint
The old tail's preceding node must become the new endpoint.
Answer
predecessor
- 32In a singly linked list, inserting at the head takes_____time when the head reference is maintained.
Hint
The new node can be connected without traversing the list.
Answer
constant
- 33A stack follows the behavior called LIFO, meaning_____in, first out.
Hint
The most recently added element is removed first.
Answer
last
- 34The two primary stack operations are push and_____.
Hint
One operation adds to the top; the other removes from the top.
Answer
pop
- 35A stack implementation using a singly linked list should add new nodes before the head so that removals can be made efficiently from the_____.
Hint
Both stack operations should act on the same end of the list.
Answer
head
- 36Stacks support recursion by keeping track of previous function calls in the call_____.
Hint
A returning function removes its current frame and resumes the prior call.
Answer
stack
- 37To check whether brackets in a string match correctly, push opening brackets and compare each closing bracket with the_____bracket on the stack.
Hint
The most recently opened bracket must be matched first.
Answer
top
- 38After processing every bracket in a properly matched sequence, the stack must be_____.
Hint
Any unmatched opening brackets would still remain stored.
Answer
empty
- 39A queue adds elements at the back and removes elements from the_____.
Hint
This ordering models people waiting in line.
Answer
front
- 40Adding an element to a queue is called_____.
Hint
This operation places a new element at the back.
Answer
enqueueing
- 41Removing the front element from a queue is called_____.
Hint
This operation removes the element that has waited the longest.
Answer
dequeuing
- 42Breadth-first search uses a queue to visit graph nodes in the order they are discovered, expanding outward from the current_____.
Hint
This is the group of nodes awaiting exploration.
Answer
frontier
- 43In a queue implemented with a linked list, maintaining both head and tail references allows enqueueing and dequeuing in_____time.
Hint
Each operation can update an endpoint without traversing the list.
Answer
constant
- 44A priority queue removes the element with the highest_____according to its ordering.
Hint
Elements are not necessarily removed in ordinary insertion order.
Answer
priority
- 45A min priority queue ordered from least to greatest removes the_____element first.
Hint
The lower-valued elements are assigned higher priority in this ordering.
Answer
smallest
- 46A heap is a tree-based data structure that satisfies the heap_____.
Hint
This rule constrains the relationship between each parent and its children.
Answer
invariant
- 47In a min heap, every parent value is less than or equal to the values of its_____.
Hint
The root therefore contains a minimum value.
Answer
children
- 48In a max heap, every parent value is greater than or equal to the values of its_____.
Hint
The root therefore contains a maximum value.
Answer
children
- 49A binary heap is a heap in which each node has at most_____children.
Hint
The name identifies the maximum branching factor.
Answer
two
- 50A complete binary tree is filled at every level except possibly the last, with nodes as far to the_____as possible.
Hint
This arrangement determines a predictable next insertion position.
Answer
left
- 51A binary heap is commonly represented with an array because its complete-tree structure makes the next insertion position the_____position in the array.
Hint
The array stores nodes level by level from left to right.
Answer
last
- 52For a zero-based heap array, the left child of the node at index i is at index_____.
Hint
The right child is one position after the left child.
Answer
2i+1
- 53Adding a value to a binary heap and moving it toward the root to restore the heap invariant is called_____.
Hint
The value moves upward through the heap.
Answer
swimming
- 54After removing a heap root, the replacement value is moved downward by comparing it with the appropriate child; this operation is called_____.
Hint
The value moves away from the root to restore heap order.
Answer
sinking
- 55Adding an element to a binary heap takes logarithmic time because the value may need to move through the heap's_____.
Hint
The complete-tree shape keeps this measure logarithmic in the number of elements.
Answer
height
- 56Looking at the root of a binary heap without removing it is called_____.
Hint
This operation returns the highest-priority value while leaving the heap unchanged.
Answer
peeking
- 57The union-find data structure tracks elements divided into one or more_____sets.
Hint
Different groups do not share elements.
Answer
disjoint
- 58The union-find operation that identifies which group contains an element is called_____.
Hint
It determines the element's component or representative.
Answer
find
- 59The union-find operation that merges two groups is called_____.
Hint
It combines two previously separate components.
Answer
union
- 60In a union-find structure, path compression makes nodes on a searched path point directly to the component's_____node.
Hint
This node represents the component.
Answer
root
- 61Kruskal's minimum spanning tree algorithm sorts edges by ascending weight and skips an edge if its endpoints are already in the same component, because adding it would create a_____.
Hint
A spanning tree cannot contain a closed path.
Answer
cycle
- 62A minimum spanning tree connects all graph vertices using a subset of edges with_____total cost.
Hint
The goal is to minimize the sum of selected edge weights.
Answer
minimal
- 63A tree is connected and_____; it has no cycles.
Hint
This property rules out closed paths.
Answer
acyclic
- 64A tree with n nodes has_____edges.
Hint
A tree has exactly one fewer edge than nodes.
Answer
n−1
- 65The topmost node selected as the starting point of a rooted tree is called its_____.
Hint
Other nodes can be described relative to this node.
Answer
root
- 66A node with no children is called a_____node.
Hint
Such nodes occur at the ends of branches.
Answer
leaf
- 67A binary search tree places smaller values in the left subtree and larger values in the_____subtree.
Hint
The ordering rule splits values around the current node.
Answer
right
- 68An inorder traversal of a binary search tree visits its values in_____order.
Hint
The traversal visits the left subtree, the node, and then the right subtree.
Answer
increasing
- 69A level-order traversal visits nodes layer by layer and is implemented using a_____.
Hint
Newly discovered nodes are processed in the order they are added.
Answer
queue
- 70A hash table maps keys to values using a technique called_____.
Hint
A function transforms a key into a number used to locate its entry.
Answer
hashing
- 71A hash function maps a key to a number in a fixed_____.
Hint
The output must fit the domain used to index the table.
Answer
range
- 72A hash function must be deterministic, so hashing the same key repeatedly always produces the same_____.
Hint
A changing output would prevent reliable lookup.
Answer
value
- 73When two different keys produce the same hash value, the event is called a hash_____.
Hint
The keys compete for the same table position.
Answer
collision
- 74Separate chaining resolves collisions by storing entries that hash to the same bucket in an auxiliary structure, commonly a_____.
Hint
The bucket can hold a sequence of entries.
Answer
linked list
- 75Open addressing resolves collisions by probing for another available position within the_____itself.
Hint
Unlike separate chaining, it does not store collisions in an auxiliary bucket structure.
Answer
table
- 76The load factor is the ratio of the number of items in a hash table to the_____of the table.
Hint
It measures how full the table is.
Answer
size
- 77Linear probing uses a probing function that changes the candidate position according to a_____function.
Hint
The offset grows proportionally with the probe number.
Answer
linear
- 78Quadratic probing changes the candidate position according to a_____function.
Hint
The offset commonly involves the square of the probe number.
Answer
quadratic
- 79Double hashing uses a secondary hash function to determine the probe_____.
Hint
This amount is used to move from the original hashed position.
Answer
offset
- 80In open addressing, a deleted entry is often replaced by a special marker called a_____.
Hint
Searches skip this marker rather than treating the slot as never occupied.
Answer
tombstone
- 81A Fenwick tree is also known as a_____tree.
Hint
Its name reflects its use of indexed array positions and binary structure.
Answer
binary indexed
- 82A Fenwick tree supports range queries and_____updates on an array.
Hint
An update changes a value at one array position.
Answer
point
- 83A Fenwick tree uses each cell to represent a range determined by the cell index's least significant_____.
Hint
This binary feature determines how many preceding positions the cell covers.
Answer
bit
- 84Fenwick tree range sums can be computed from two_____sums.
Hint
Subtract the accumulated total before the range from the total through its endpoint.
Answer
prefix
- 85Constructing a Fenwick tree by adding every array value separately takes O(nlog(n)), while propagating values to parent cells can construct it in_____time.
Hint
The improved construction processes and propagates each position a bounded number of times.
Answer
linear
- 86A suffix is a nonempty substring that appears at the_____of a string.
Hint
Suffixes are formed by taking a string through its final character.
Answer
end
- 87A suffix array stores the starting indices of a string's suffixes in_____order.
Hint
The suffixes are ordered as words would be in a dictionary.
Answer
lexicographic
- 88The longest common prefix array records how many characters adjacent sorted suffixes have in_____.
Hint
Each entry measures the shared beginning of two neighboring suffixes.
Answer
common
- 89For a string of length n, the total number of substrings is 2n(n+1), and the sum of the LCP values counts the_____substrings.
Hint
Subtracting these from the total yields the number of unique substrings.
Answer
repeated
- 90The longest repeated substring can be found by taking the maximum value in the_____array.
Hint
The largest shared prefix between adjacent sorted suffixes is the longest repeated substring.
Answer
LCP
- 91To use a suffix array for the longest common substring problem across multiple strings, concatenate the strings with unique_____values between them.
Hint
These special separators prevent suffixes from running across string boundaries.
Answer
sentinel
- 92For the longest common substring shared by at least k strings, a sliding window over sorted suffixes must contain at least k different_____.
Hint
Each color identifies which original string a suffix came from.
Answer
colors
- 93Within a valid suffix-array window, the shared prefix length is determined by the minimum relevant_____value.
Hint
Every suffix in the window must share at least this many initial characters.
Answer
LCP
- 94An ordinary binary search tree can have linear worst-case operations if it degenerates into a_____.
Hint
This can happen when values are inserted in increasing order.
Answer
chain
- 95A balanced binary search tree adjusts its structure to maintain a height that grows_____with the number of nodes.
Hint
The structure avoids the linear-height chain case.
Answer
logarithmically
- 96Tree rotations preserve the binary search tree ordering while changing the tree's_____.
Hint
They rearrange parent-child relationships without changing the sorted order.
Answer
structure
- 97An AVL tree maintains a balance factor equal to the right subtree height minus the_____subtree height.
Hint
This signed difference indicates which side is taller.
Answer
left
- 98In an AVL tree, every node's balance factor must be one of negative one, zero, or positive_____.
Hint
A larger imbalance requires rotations.
Answer
one
- 99An AVL node with balance factor positive two is right heavy and must be repaired with suitable tree_____.
Hint
The repair depends on whether the imbalance is right-right or right-left.
Answer
rotations
- 100The four AVL imbalance cases are left-left, left-right, right-right, and_____.
Hint
This case is the mirror of left-right.
Answer
right-left
- 101An indexed priority queue supports efficient value updates and deletions by maintaining mappings between keys and heap_____.
Hint
These mappings allow the structure to locate a key without scanning the heap.
Answer
positions
- 102An indexed priority queue's position map identifies the heap node position for a given key_____.
Hint
This is the integer identifier associated with the key.
Answer
index
- 103An indexed priority queue's inverse map identifies the key index associated with a given heap_____.
Hint
It supports looking up which key is stored at a node.
Answer
position
- 104A traditional heap may need a linear search to remove a non-root value, but an indexed priority queue can locate the key in constant time and then restore heap order in_____time.
Hint
Repositioning a node takes time proportional to the heap's height.
Answer
logarithmic
- 105In a min indexed priority queue, a decrease-key operation can move the updated node_____the heap.
Hint
A smaller value has higher priority in a min heap.
Answer
up
- 106An indexed priority queue's values array is indexed by key index rather than by heap node_____.
Hint
The maps connect this array to the heap's changing arrangement.
Answer
position

Ask anything
We've read this whole study set, so questions about it get the best answers.