Data Structures Introduction
- 61Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
61 questions
- 1A_____is a way to store, organize, and manage data so that a programmer can easily access or modify values.
Hint
Think of the fundamental concept for storing related information in computer science.
Answer
data structure
- 2The four common criteria used to measure data structure efficiency in Big O notation are access, search, insert, and_____.
Hint
It is one of the basic operations you can perform on a data structure, completing the set of four criteria.
Answer
delete
- 3In Big O notation, the time complexity equation uses_____to represent the number of operations needed based on the size of the data set.
Hint
It is a common variable used to denote the number of elements in a data set.
Answer
n
- 4When judging data structures using Big O, we always consider the_____case scenario to prepare for the worst conditions.
Hint
This ensures that the performance is acceptable even under the most demanding circumstances.
Answer
worst
- 5A time complexity of_____means the number of operations is constant, regardless of the data set size.
Hint
This is the gold standard for efficiency, often called constant time.
Answer
O(1)
- 6The time complexity_____is slower than O(1) but faster than O(n), and its efficiency improves as the data set grows.
Hint
Think of algorithms like binary search that reduce the search space by half each step.
Answer
O(log n)
- 7A linear time complexity equation is represented as_____.
Hint
The number of operations increases proportionally with the size of the data.
Answer
O(n)
- 8The time complexity O(n log n) is the first one considered relatively_____in terms of efficiency.
Hint
It is worse than O(n) and its graph shows an increasing slope.
Answer
bad
- 9An array's size cannot be changed once it is_____.
Hint
This is a key limitation that distinguishes arrays from other data structures.
Answer
created
- 10The first index of an array is always_____.
Hint
Think about the starting point for counting positions in programming.
Answer
0
- 11Accessing an element in an array has time complexity_____because the computer can calculate the memory address instantly.
Hint
This is due to contiguous storage and fixed element size.
Answer
O(1)
- 12Searching for an element in an unsorted array requires a_____search in the worst case, resulting in O(n) time.
Hint
It goes through each element one by one until the target is found.
Answer
linear
- 13Inserting an element at the beginning of an array requires shifting all elements to the_____, resulting in O(n) time.
Hint
You need to make room for the new element by moving existing elements.
Answer
right
- 14When using parallel arrays, each element in one array corresponds to the element in the other array at the same_____.
Hint
Think about how related data is aligned across multiple arrays.
Answer
position
- 15A two-dimensional array can be thought of as a_____.
Hint
It has rows and columns, similar to a grid.
Answer
matrix
- 16An ArrayList is fundamentally a_____array.
Hint
It can grow or shrink dynamically as elements are added or removed.
Answer
resizeable
- 17In many languages, an ArrayList is backed by an_____in memory.
Hint
Behind the scenes, it uses a simpler data structure to store the elements.
Answer
array
- 18The ArrayList method_____appends an object to the end of the list.
Hint
This method is used to insert elements without specifying an index.
Answer
add
- 19The_____method in ArrayList removes an element at a specified index or the first occurrence of an object.
Hint
It can take an index or an object as an argument.
Answer
remove
- 20The ArrayList method_____replaces the element at a specified index with a new object.
Hint
It takes an index and a new value to place there.
Answer
set
- 21The conversion method_____turns an ArrayList into an array.
Hint
This method returns an array containing all elements of the ArrayList.
Answer
toArray
- 22A stack is a sequential access data structure that follows the_____principle.
Hint
It's an acronym for 'Last In, First Out'.
Answer
LIFO
- 23In a stack, elements are added using the_____method and removed using the pop method.
Hint
Think about pushing plates onto a spring-loaded stack.
Answer
push
- 24The stack method_____allows you to view the top element without removing it.
Hint
It gives you a glance at the top value.
Answer
peek
- 25Inserting an element into a stack has time complexity_____because it only involves adding to the top.
Hint
The operation requires a fixed number of steps regardless of stack size.
Answer
O(1)
- 26A common real-world use of stacks is the_____feature in word processors.
Hint
It allows you to reverse the last action.
Answer
undo
- 27A queue is a sequential access data structure that follows the_____principle.
Hint
It stands for 'First In, First Out'.
Answer
FIFO
- 28In a queue, elements are added to the_____and removed from the front.
Hint
Also known as the tail.
Answer
back
- 29The method used to remove an element from a queue is_____.
Hint
It is the counterpart of enqueue.
Answer
dequeue
- 30Deleting from a queue has time complexity_____because you only remove from the front.
Hint
It takes a constant number of steps.
Answer
O(1)
- 31Queues are used for_____in computers, determining which tasks to complete next.
Hint
It's a process that manages the order of tasks to be executed.
Answer
job scheduling
- 32In a linked list, each element is an object called a_____that contains data and a pointer to the next node.
Hint
Think of it as a building block of the linked list.
Answer
node
- 33The last node in a linked list has its pointer set to_____to indicate the end of the list.
Hint
It represents nothing or absence of a reference.
Answer
null
- 34Adding a node to the_____of a linked list only requires setting the new node's pointer to the current head.
Hint
Think about inserting at the beginning.
Answer
head
- 35Removing a node from the middle of a linked list involves adjusting the_____of the previous node to skip over the node to be removed.
Hint
This is how you keep the chain intact.
Answer
pointer
- 36Accessing an element in a linked list has time complexity_____because you must traverse from the head.
Hint
You may need to go through many nodes to reach the desired one.
Answer
O(n)
- 37A doubly linked list has pointers to both the next node and the_____node.
Hint
This allows traversal in both directions.
Answer
previous
- 38A common use of doubly linked lists is the back and forth functionality in_____caches.
Hint
This allows you to navigate through previously visited web pages.
Answer
browser
- 39A dictionary stores data in the form of_____pairs.
Hint
Each element has a unique identifier and an associated value.
Answer
key-value
- 40In a dictionary, every key must be_____and can only have one value.
Hint
No two entries can share the same key.
Answer
unique
- 41The most common way to implement a dictionary is using a_____.
Hint
This data structure uses a hash function to map keys to indices.
Answer
hash table
- 42A hash function takes a key and returns an_____where the key's value should be stored.
Hint
It maps to a position in an array.
Answer
index
- 43When two keys hash to the same index, it is called a hash_____.
Hint
This requires a method to resolve the conflict.
Answer
collision
- 44Closed addressing resolves hash collisions by storing keys that hash to the same index in a_____.
Hint
Chaining uses a secondary data structure at that index.
Answer
linked list
- 45In a tree, the topmost node is called the_____.
Hint
It is the starting point of the tree.
Answer
root
- 46Nodes directly below a parent node are called_____nodes.
Hint
Think of familial relationships.
Answer
child
- 47A node with no children in a tree is called a_____node.
Hint
It is at the end of a branch.
Answer
leaf
- 48The height of a tree is the number of edges on the longest path from the root to a_____.
Hint
It measures the maximum depth.
Answer
leaf
- 49In a binary search tree, the left child of a parent node has a value_____the parent node.
Hint
This property helps in efficient searching.
Answer
less than
- 50Searching in a binary search tree has time complexity_____in the average case.
Hint
The tree structure allows you to eliminate half the nodes at each step.
Answer
O(log n)
- 51A try is also known as a_____tree, used for storing characters to facilitate word retrieval.
Hint
It stores words by common prefixes.
Answer
prefix
- 52In a trie, the end of a word is marked by a_____to indicate that a complete word exists at that point.
Hint
It tells the program to stop and recognize a word.
Answer
flag
- 53Tries are commonly used for features like_____on smartphones.
Hint
It suggests words as you type.
Answer
autocomplete
- 54In a min heap, the root node contains the_____value among all nodes.
Hint
It is the smallest element in the heap.
Answer
minimum
- 55After inserting a node into a heap, you may need to swap it up to maintain the heap property; this process is called_____.
Hint
It adjust the heap to restore order.
Answer
heapify
- 56The sorting algorithm that repeatedly removes the root of a heap to produce a sorted list is called_____.
Hint
It uses the heap data structure to sort elements.
Answer
heapsort
- 57A graph is composed of a set of vertices and a set of_____.
Hint
These are the connections between vertices.
Answer
edges
- 58An undirected graph is one in which the edges have no_____; traversal can go both ways.
Hint
Think of a friendship where the relationship is mutual.
Answer
direction
- 59A graph that contains a path from a node back to itself is called a_____graph.
Hint
It has at least one cycle.
Answer
cyclic
- 60Associating a numerical value with an edge in a graph is called_____.
Hint
This value often represents cost or distance.
Answer
weighting
- 61Dijkstra's algorithm finds the shortest path from a source vertex to all others in a graph with_____edges.
Hint
It requires non-negative weights.
Answer
weighted

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