Data Structures and Algorithms
- 63Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
63 questions
- 1The step-by-step instructions used to solve a problem are called an_____.
Hint
Think of a precise procedure for completing a task.
Answer
algorithm
- 2The way data is arranged inside computer memory can have a significant effect on an algorithm's_____.
Hint
Consider how quickly or efficiently the algorithm runs.
Answer
performance
- 3Searching an unsorted collection one element at a time has a worst-case running time of_____.
Hint
The number of steps grows directly with the number of elements.
Answer
linear time
- 4Binary search repeatedly divides a sorted problem into_____parts.
Hint
The prefix in the word binary refers to this number.
Answer
two
- 5Binary search requires the data to be_____before the search begins.
Hint
The algorithm decides which half to eliminate based on the ordering of values.
Answer
sorted
- 6The logarithmic running time of binary search is commonly written as big O of_____.
Hint
The search space is repeatedly halved.
Answer
log2n
- 7Big O notation describes an algorithm's asymptotic_____bound.
Hint
It limits how much time an algorithm may take as the input grows.
Answer
upper
- 8The notation used to express an asymptotic lower bound is capital omega, written as_____.
Hint
This is the Greek symbol paired conceptually with big O.
Answer
Ω
- 9When an algorithm's upper and lower bounds coincide, its running time can be described using capital_____.
Hint
This Greek letter indicates a tight bound.
Answer
theta
- 10A computer can jump directly to a memory location in_____time.
Hint
The operation takes the same amount of time regardless of the location.
Answer
constant time
- 11A computer's memory commonly groups 0s and 1s into units of 8 bits called a_____.
Hint
Eight bits make up this standard unit of digital storage.
Answer
byte
- 12An array is a_____block of memory whose values are stored next to one another.
Hint
The values occupy consecutive memory locations.
Answer
contiguous
- 13The first index of a six-element array using zero-based indexing is_____.
Hint
Counting begins with the value used to represent no offset.
Answer
0
- 14In zero-based indexing, the last index of an array containing n elements is_____.
Hint
The first element uses index 0, so the final index is one less than the number of elements.
Answer
n−1
- 15To find the midpoint of seven indexed locations, a computer can calculate 7÷2 and_____the result.
Hint
The midpoint index must be an integer.
Answer
round down
- 16The random access in an array is possible because each element has a predictable_____from the beginning of the array.
Hint
Use the idea of equal spacing between elements.
Answer
offset
- 17RAM stands for_____Access Memory.
Hint
The first word describes the ability to access any byte directly.
Answer
Random
- 18A DIMM is a Dual In-line_____Module.
Hint
It is a module containing memory chips.
Answer
Memory
- 19In Python, a true or false value has the type_____.
Hint
The type name is an abbreviation for Boolean.
Answer
bool
- 20In Python, a number that can contain a decimal portion has the type_____.
Hint
This type represents a floating-point value.
Answer
float
- 21In Python, a whole-number value has the type_____.
Hint
The type name is short for integer.
Answer
int
- 22In Python, a sequence of characters has the type_____.
Hint
The type name is abbreviated from string.
Answer
str
- 23A Python dictionary is another name for a_____table.
Hint
It uses a function to map keys to locations.
Answer
hash
- 24A Python list resembles an array but can dynamically_____and shrink.
Hint
Unlike a fixed-size array, it can accommodate changing numbers of elements.
Answer
grow
- 25A Python set stores a collection of values with no_____.
Hint
Each value appears at most once.
Answer
duplicates
- 26A Python tuple can represent a fixed grouping such as_____or latitude and longitude.
Hint
Think of a coordinate pair.
Answer
x, y
- 27Bubble sort repeatedly compares_____elements at a time.
Hint
The elements are next to each other in the collection.
Answer
adjacent
- 28In bubble sort, the process repeats until there are no_____.
Hint
A pass with no exchanges indicates that the collection is ordered.
Answer
swaps
- 29In bubble sort, an adjacent pair is exchanged when the pair is_____.
Hint
The left and right values violate the desired ordering.
Answer
out of order
- 30In bubble sort pseudocode, if there are n elements, adjacent comparisons proceed through position_____.
Hint
The comparison also examines the next position, so the final starting position is one before the last index.
Answer
n−2
- 31Selection sort repeatedly finds the_____remaining element.
Hint
It places the next item in sorted order at the current position.
Answer
smallest
- 32During selection sort, the selected minimum is swapped with the element at the current_____.
Hint
This is the location where the next sorted element belongs.
Answer
position
- 33For n elements, selection sort performs a number of comparisons that sums to n−1+n−2+⋯+1, which equals_____.
Hint
Use the formula for the sum of the first n−1 positive integers.
Answer
2n(n−1)
- 34Both bubble sort and selection sort have a typical asymptotic running time of_____.
Hint
Each algorithm performs roughly n work across roughly n passes.
Answer
O(n2)
- 35Merge sort divides the data into smaller portions and then_____the sorted portions.
Hint
The algorithm's name describes the final combination step.
Answer
merges
- 36Merge sort has an asymptotic running time of_____.
Hint
It combines linear work across logarithmically many levels.
Answer
O(nlogn)
- 37Merge sort can be faster than bubble sort and selection sort because it uses additional_____.
Hint
The algorithm temporarily stores portions of the data elsewhere.
Answer
space
- 38Sorting algorithms that modify the original collection without requiring a separate collection are said to work_____place.
Hint
The data is rearranged within its existing storage.
Answer
in
- 39An array's elements must be stored next to one another, so adding an element may require_____the entire array.
Hint
If the adjacent memory is occupied, the collection may need to move elsewhere.
Answer
relocating
- 40Allocating much more array space than currently needed can waste_____.
Hint
Reserved but unused storage cannot be used for other tasks.
Answer
memory
- 41The trade-off between execution time and memory usage is an example of a resource_____.
Hint
Improving one resource may require spending more of another.
Answer
trade-off
- 42A linked list stores elements that are connected by_____containing the location of another element.
Hint
These are represented graphically as arrows.
Answer
pointers
- 43The individual boxes that hold values in a linked list are called_____.
Hint
Each unit stores data and a link to another unit.
Answer
nodes
- 44The final node in a linked list indicates that there is no next node by storing a null or equivalent_____value.
Hint
The chain terminates at this point.
Answer
dead end
- 45Unlike an array, a linked list does not support constant-time_____access to an arbitrary element.
Hint
You cannot calculate the middle element's location directly from the beginning.
Answer
random
- 46Searching a linked list may require traversing from the first node to the last, giving it a worst-case running time of_____.
Hint
The number of links followed can grow with the number of nodes.
Answer
linear time
- 47A linked list requires additional space for each node's stored_____.
Hint
This metadata identifies where the next node is located.
Answer
address
- 48The main advantage of a linked list over a fixed-size array is dynamic_____and removal.
Hint
The structure can change size without reserving one contiguous block in advance.
Answer
growth
- 49Removing a node from a linked list can be done by updating the pointer so that the node is_____from the chain.
Hint
Think of cutting one link and reconnecting the surrounding nodes.
Answer
snipped
- 50A tree node with no more than two children belongs to a_____tree.
Hint
The prefix refers to two possible branches.
Answer
binary
- 51In a binary search tree, values smaller than a node are placed in its_____subtree.
Hint
Values larger than the node go in the opposite direction.
Answer
left
- 52In a binary search tree, values larger than a node are placed in its_____subtree.
Hint
This is the side opposite values smaller than the node.
Answer
right
- 53The top node of a tree is called the_____.
Hint
It is the starting point from which the tree grows downward.
Answer
root
- 54A binary search tree can support search and insertion in approximately_____time when it remains balanced.
Hint
Each comparison can eliminate roughly half of the remaining tree.
Answer
O(log2n)
- 55If a binary search tree becomes long and one-sided, it can effectively devolve into a_____.
Hint
The tree loses its branching structure and becomes a chain.
Answer
linked list
- 56A binary search tree uses extra space for pointers to as many as_____children per node.
Hint
The structure is binary.
Answer
two
- 57A hash table uses a_____function to convert a key into an array location.
Hint
The function determines which bucket should store the key.
Answer
hash
- 58When two different keys map to the same hash-table location, a_____occurs.
Hint
Two inputs compete for the same bucket.
Answer
collision
- 59A hash table's inputs are called_____and the associated outputs are called values.
Hint
Dictionaries associate these identifiers with stored results.
Answer
keys
- 60Using only the first letter of a name as a hash function groups all names beginning with that letter into the same_____.
Hint
It is a location or category in the hash table.
Answer
bucket
- 61If a hash function distributes keys poorly, a hash table can degrade to_____time.
Hint
Many collisions can create a long linked list in one bucket.
Answer
linear
- 62A good hash function should minimize the number of_____between different keys.
Hint
Fewer competing keys make lookup more efficient.
Answer
collisions
- 63With a well-designed hash function and few collisions, hash-table lookup can approach_____time.
Hint
The lookup time is intended to be independent of the number of stored items.
Answer
constant

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