Intro to Data Structures
- 48Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
48 questions
- 1A data structure is a way to store and organize data in a computer so that the data can be used_____.
Hint
Think about the goal of using data structures.
Answer
efficiently
- 2When studying data structures as mathematical and logical models, we define them as_____.
Hint
This term describes a model that defines data and operations without implementation details.
Answer
abstract data types
- 3A list that can store a fixed number of elements and allows read/modify by position is called a_____list.
Hint
This type of list has a predetermined size that does not change.
Answer
static
- 4In an array-based dynamic list, when the array is full, a common strategy is to create a new array of_____the size of the previous array.
Hint
This size increase is chosen to balance cost and efficiency.
Answer
double
- 5Accessing an element in an array by index takes_____time.
Hint
This time does not depend on the size of the array.
Answer
constant
- 6Inserting an element at a given position in an array requires shifting elements and takes_____time in the worst case.
Hint
This time complexity is linear in the number of elements.
Answer
O(n)
- 7In a linked list, each node contains a data field and a field that stores the_____of the next node.
Hint
This field links the node to the next node in the list.
Answer
address
- 8The first node in a linked list is called the_____node.
Hint
This node is the starting point of the list.
Answer
head
- 9Inserting a node at the beginning of a linked list takes_____time.
Hint
This time does not depend on the length of the list.
Answer
constant
- 10In a linked list, to insert a node at the end, we must traverse the entire list, making the operation take_____time.
Hint
This time complexity is linear in the number of nodes.
Answer
O(n)
- 11A linked list node in C is typically defined as a structure with a data field and a_____field pointing to the next node.
Hint
This field stores the address of the next node.
Answer
pointer
- 12To delete a node from a linked list, we must first adjust the links so that the node is_____from the list, then free its memory.
Hint
This ensures the node is no longer reachable.
Answer
detached
- 13In a doubly linked list, each node contains an additional pointer to the_____node.
Hint
This pointer allows reverse traversal.
Answer
previous
- 14A stack is a last-in-first-out (LIFO) data structure where insertion and deletion occur at the_____of the stack.
Hint
This is the only accessible end.
Answer
top
- 15The operation of inserting an element onto a stack is called_____.
Hint
This is the standard term for stack insertion.
Answer
push
- 16The operation of removing the top element from a stack is called_____.
Hint
This is the standard term for stack removal.
Answer
pop
- 17In an array-based stack implementation, the variable that keeps track of the top index is initially set to_____to indicate an empty stack.
Hint
This value is not a valid array index.
Answer
-1
- 18A common application of a stack is to check whether_____in an expression are balanced.
Hint
This includes brackets and braces.
Answer
parentheses
- 19In the expression evaluation, postfix notation is also called_____notation.
Hint
This notation places the operator after the operands.
Answer
Reverse Polish
- 20To evaluate a postfix expression, we scan it from left to right and use a_____to store operands.
Hint
This data structure is used to temporarily hold values.
Answer
stack
- 21In a queue, insertion occurs at the_____end and deletion occurs at the front end.
Hint
This is also called the tail.
Answer
rear
- 22The queue operation that adds an element is called_____.
Hint
This is also sometimes called push.
Answer
enqueue
- 23The queue operation that removes an element from the front is called_____.
Hint
This is also sometimes called pop.
Answer
dequeue
- 24In a circular array-based queue, the next index after the last position is calculated using the_____operator.
Hint
This operator gives the remainder of division.
Answer
modulo
- 25A tree is a_____data structure, unlike arrays and linked lists which are linear.
Hint
Data is organized hierarchically.
Answer
non-linear
- 26The topmost node in a tree is called the_____.
Hint
This node has no parent.
Answer
root
- 27A node that has no children is called a_____node.
Hint
These are the terminal nodes.
Answer
leaf
- 28The number of edges in the longest path from a node to a leaf is called its_____.
Hint
This is a measure of distance downward.
Answer
height
- 29The number of edges in the path from the root to a node is called its_____.
Hint
This is a measure of distance from the root.
Answer
depth
- 30In a binary tree, each node can have at most_____children.
Hint
This is the defining property of a binary tree.
Answer
two
- 31A binary tree in which each node has either zero or two children is called a_____binary tree.
Hint
Also known as a proper binary tree.
Answer
strict
- 32A binary tree where all levels except possibly the last are completely filled, and nodes are as far left as possible, is called a_____binary tree.
Hint
This type is often used in heaps.
Answer
complete
- 33In a binary search tree, for each node, all values in the left subtree are_____than the node's value.
Hint
Or 'less than or equal' if duplicates are allowed.
Answer
lesser
- 34Searching for a value in a balanced binary search tree takes_____time.
Hint
This is the reason BSTs are efficient for search.
Answer
O(logn)
- 35In an in-order traversal of a binary search tree, the nodes are visited in_____order.
Hint
This traversal processes left subtree, then node, then right subtree.
Answer
sorted
- 36The pre-order traversal visits nodes in the order: root,_____, right subtree.
Hint
This is the 'visit left before right' order.
Answer
left subtree
- 37The post-order traversal visits nodes in the order: left subtree, right subtree,_____.
Hint
Root is visited last.
Answer
root
- 38To delete a node with two children in a BST, we replace it with the minimum node from its_____subtree.
Hint
Alternatively, the maximum from the left subtree.
Answer
right
- 39A graph consists of a set of vertices and a set of_____.
Hint
These connect pairs of vertices.
Answer
edges
- 40In an undirected graph, each edge is an unordered pair of vertices, meaning the connection is_____.
Hint
The relationship is mutual.
Answer
bidirectional
- 41A graph with all directed edges is called a_____graph or digraph.
Hint
Edges have a direction from one vertex to another.
Answer
directed
- 42A graph in which edges have associated values (costs) is called a_____graph.
Hint
These values often represent distances or costs.
Answer
weighted
- 43The representation of a graph using a two-dimensional array is called an_____matrix.
Hint
Rows and columns represent vertices.
Answer
adjacency
- 44For a sparse graph, a more memory-efficient representation is an_____list.
Hint
Each vertex has a list of its neighbors.
Answer
adjacency
- 45A graph is called_____connected if there is a path from any vertex to any other vertex in an undirected graph.
Hint
No vertex is isolated.
Answer
connected
- 46For a directed graph, if there is a path between every ordered pair of vertices, it is called_____connected.
Hint
This property requires paths in both directions.
Answer
strongly
- 47A walk that starts and ends at the same vertex with no repeated vertices (except the start/end) is called a_____.
Hint
This is a closed loop.
Answer
cycle
- 48A tree is an example of an_____graph (no cycles).
Hint
It has no cycles.
Answer
acyclic

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