Data Structures Course
- 64Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
64 questions
- 1Data structures are a way to store, organize, and_____data.
Hint
Think about what you can do with data besides storing and organizing it.
Answer
manipulate
- 2The two main categories of data structures are linear and_____.
Hint
Consider the opposite of linear in terms of structure.
Answer
non-linear
- 3Arrays, linked lists, stacks, and queues are examples of_____data structures.
Hint
Think about the order in which elements are arranged.
Answer
linear
- 4Data structures are not the same as_____; for example, integer and boolean are the latter.
Hint
Consider the difference between a primitive piece of data and a structure that holds multiple pieces.
Answer
data types
- 5An array is an_____collection of elements.
Hint
Think about how elements are accessed by index.
Answer
ordered
- 6A fixed-size array's size is defined at initialization and_____be changed.
Hint
The opposite of dynamic.
Answer
cannot
- 7Initializing a fixed-size array with n elements takes_____time.
Hint
Think about how many memory slots need to be allocated.
Answer
O(n)
- 8Accessing an element in an array by index takes_____time due to memory addressing.
Hint
The time is constant regardless of array size.
Answer
O(1)
- 9Inserting an element in a fixed-size array at any position except the end typically takes_____time.
Hint
Consider the number of elements that need to be shifted.
Answer
O(n)
- 10In a fixed-size array, inserting an element at the last position takes_____time.
Hint
No shifting is needed.
Answer
O(1)
- 11Deleting an element from a fixed-size array at the beginning takes_____time.
Hint
Think about how many elements must be moved to fill the gap.
Answer
O(n)
- 12In a dynamic array, when resizing, the new size is often_____the original size.
Hint
This is a common strategy to amortize the cost.
Answer
double
- 13The push (or enqueue) operation in an array-based queue implemented with the front at index 0 takes_____time.
Hint
Adding to the end is efficient.
Answer
O(1)
- 14In a singly linked list, each node contains a value and a_____pointer.
Hint
This pointer connects to the following node.
Answer
next
- 15Accessing an element in a singly linked list requires_____traversal from the head.
Hint
You must follow the next pointers one by one.
Answer
sequential
- 16The first node of a linked list is called the_____.
Hint
It is the entry point to the list.
Answer
head
- 17In a circular singly linked list, the last node's next pointer points to the_____.
Hint
This creates a loop.
Answer
head
- 18In a circular singly linked list, storing the tail node allows insertion at the front in_____time.
Hint
No traversal is needed.
Answer
O(1)
- 19In a singly linked list, inserting a node in the middle without a reference to the previous node takes_____time.
Hint
You need to traverse to find the insertion point.
Answer
O(n)
- 20In a doubly linked list, each node has a_____pointer in addition to the next pointer.
Hint
It points to the node before.
Answer
previous
- 21In a doubly linked list, if you have a reference to a node, you can insert a new node before it in_____time.
Hint
You have access to the previous node via the prev pointer.
Answer
O(1)
- 22The main disadvantage of a doubly linked list compared to a singly linked list is increased_____usage.
Hint
Think about the additional data stored per node.
Answer
space
- 23Queues operate on the_____principle: first in, first out.
Hint
The acronym for the property.
Answer
FIFO
- 24The operation that adds an element to the back of a queue is often called_____.
Hint
One of the two main queue operations.
Answer
enqueue
- 25The operation that removes an element from the front of a queue is called_____.
Hint
It retrieves and removes the front element.
Answer
dequeue
- 26Using an array to implement a queue where elements are enqueued at the end and dequeued from the front results in a_____time complexity for dequeue.
Hint
Shifting is required.
Answer
O(n)
- 27A more efficient implementation of a queue uses a_____with a tail pointer.
Hint
This data structure allows constant-time operations at both ends.
Answer
singly linked list
- 28Stacks operate on the_____principle: last in, first out.
Hint
The opposite of a queue.
Answer
LIFO
- 29The two main operations of a stack are push and_____.
Hint
The operation that removes the top element.
Answer
pop
- 30Stacks can be efficiently implemented using an_____because all operations occur at the same end.
Hint
Think of adding and removing from the end of the array.
Answer
array
- 31One common use of a stack is implementing the_____button in a web browser.
Hint
Navigating to previous pages.
Answer
back
- 32Using two stacks to implement a queue requires that one of the operations (push or pop) takes_____time.
Hint
Not all operations are constant; one is linear.
Answer
O(n)
- 33In the two-stack queue implementation, elements are first pushed onto the_____stack.
Hint
The stack where new items are initially placed.
Answer
input
- 34In a binary tree, a node with no children is called a_____node.
Hint
It is at the bottom of the tree.
Answer
leaf
- 35The maximum number of nodes in a binary tree of height h is_____.
Hint
The formula involves powers of 2.
Answer
2^(h+1)-1
- 36Breadth-first search (BFS) of a binary tree uses a_____data structure.
Hint
Processes nodes level by level.
Answer
queue
- 37Depth-first search (DFS) of a binary tree uses a_____data structure.
Hint
Explores as deep as possible along each branch.
Answer
stack
- 38In an inorder traversal of a binary tree, the order is: left subtree, current node,_____.
Hint
It follows a specific pattern.
Answer
right subtree
- 39In a preorder traversal of a binary tree, the current node is visited_____the subtrees.
Hint
The prefix 'pre' indicates the order.
Answer
before
- 40In a postorder traversal of a binary tree, the current node is visited_____the subtrees.
Hint
The prefix 'post' indicates the order.
Answer
after
- 41A binary tree where every node has 0 or 2 children is called a_____binary tree.
Hint
No node has exactly one child.
Answer
full
- 42A binary tree where all levels are completely filled except possibly the last, and nodes in the last level are as far left as possible, is called a_____binary tree.
Hint
It is almost full.
Answer
complete
- 43A balanced binary tree must satisfy that for every node, the heights of its left and right subtrees differ by no more than_____.
Hint
A small constant.
Answer
1
- 44A binary tree where every level is completely filled is called a_____binary tree.
Hint
All nodes have two children except leaves.
Answer
perfect
- 45In a binary search tree, all values in the left subtree of a node are_____the node's value.
Hint
Comparison with the node value.
Answer
less than
- 46In a binary search tree, searching for an element takes O(_____) time, where h is the height.
Hint
Depends on the tree height.
Answer
h
- 47When deleting a node in a BST that has two children, you replace it with the minimum value from the_____subtree.
Hint
The smallest value greater than the node.
Answer
right
- 48In a balanced BST, the height is approximately_____of the number of nodes.
Hint
The logarithm base 2.
Answer
log2 n
- 49In a max heap, the value of each parent node is_____than or equal to its children.
Hint
The root is the maximum.
Answer
greater
- 50Heaps are typically implemented using an_____because they form a complete binary tree.
Hint
A contiguous memory structure.
Answer
array
- 51In an array-based heap, the left child of the node at index i is at index_____.
Hint
Relates to parent index i.
Answer
2i+1
- 52In an array-based heap, the right child of the node at index i is at index_____.
Hint
One more than the left child.
Answer
2i+2
- 53The process of inserting an element into a heap involves adding it at the end and then_____up.
Hint
Moving upward to restore the heap property.
Answer
sifting
- 54The time complexity of inserting an element into a heap is O(_____).
Hint
Base 2 logarithm.
Answer
log n
- 55A graph consists of two sets: vertices and_____.
Hint
Connections between vertices.
Answer
edges
- 56In an undirected graph, edges are_____.
Hint
They can be traversed in both directions.
Answer
bidirectional
- 57A graph that has weights associated with edges is called a_____graph.
Hint
Each edge has a cost or distance.
Answer
weighted
- 58A graph that contains at least one cycle is called a_____graph.
Hint
The opposite of acyclic.
Answer
cyclic
- 59An adjacency matrix for a graph with V vertices has dimensions_____.
Hint
Square matrix.
Answer
V x V
- 60An adjacency list representation uses_____to store edges for each vertex.
Hint
A node-based structure.
Answer
linked lists
- 61The adjacency list representation is more space-efficient for_____graphs.
Hint
Graphs with few edges relative to vertices.
Answer
sparse
- 62The output of a hash function is often called a_____or hash.
Hint
A concise representation.
Answer
digest
- 63A situation where two different inputs produce the same hash output is called a_____.
Hint
It's a problem to resolve.
Answer
hash collision
- 64In a perfect hash table, lookup operations run in_____time.
Hint
Constant time.
Answer
O(1)

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