WorksheetsData Structures Quiz
Total questions: 74
Worksheet time: 37mins
What is a data structure?
A type of algorithm
A method for organizing and storing data
A programming language
A hardware component
Which of the following is a linear data structure?
Tree
Array
Hash Table
Graph
What is the main advantage of a linked list over an array?
Dynamic size
Easier to implement
Faster access time
Less memory usage
What does ADT stand for?
Advanced Data Technique
Abstract Data Type
Applied Data Theory
Algorithm Data Type
Which operation is NOT typically associated with a stack?
Push
Pop
Enqueue
Peek
What is the time complexity of linear search?
O(n log n)
O(log n)
O(n)
O(1)
In which data structure is the last element added the first one to be removed?
Array
Linked List
Stack
Queue
What is the primary use of a hash table?
To create a binary tree
To store data in a sorted manner
To allow fast data retrieval
To implement a stack
Which of the following is a type of sorting algorithm?
Breadth First Search
Depth First Search
Binary Search
Bubble Sort
What is the worst-case time complexity of quicksort?
O(n)
O(n^2)
O(log n)
O(n log n)
Which data structure uses a FIFO (First In First Out) method?
Linked List
Stack
Queue
Array
What is the primary purpose of a priority queue?
To implement a stack
To allow elements to be processed based on priority
To create a binary tree
To store elements in a sorted order
Which of the following is NOT a type of linked list?
Circular Linked List
Triangular Linked List
Doubly Linked List
Singly Linked List
What is the main disadvantage of using an array?
Fixed size
Dynamic size
Easier to implement
Faster access time
Which traversal method is used in depth-first search?
All of the above
Post-order
In-order
Pre-order
What is the time complexity of bubble sort in the worst case?
O(n log n)
O(n^2)
O(log n)
O(n)
Which data structure is best for implementing recursion?
Stack
Queue
Linked List
Array
What is the primary function of a binary search tree?
To store data in a sorted manner
To create a hash table
To allow fast data retrieval
To implement a stack
Which of the following is a characteristic of a min-heap?
The parent node is always less than its children
Both b and c
The parent node is always greater than its children
It is a complete binary tree
What is the main purpose of a graph?
To create a hash table
To represent relationships between objects
To store data in a sorted manner
To implement a stack
Which of the following is NOT a graph traversal method?
Depth First Search
Breadth First Search
Linear Search
Both a and b
What is the time complexity of insertion sort in the worst case?
O(n log n)
O(n^2)
O(n)
O(log n)
Which of the following is a characteristic of a doubly linked list?
Each node has two pointers
Both b and c
It is a linear data structure
Each node has one pointer
What is the main advantage of using a circular queue?
Dynamic size
Faster access time
Easier to implement
No wasted space
Which of the following is a characteristic of a stack?
Elements are added at the front
Elements are removed from the back
Elements are removed from the front
Elements are added at the back
What is the primary use of a hash function?
To allow fast data retrieval
To store data in a sorted manner
To create a binary tree
To implement a stack
Which of the following is NOT a type of sorting algorithm?
Selection Sort
Traversal Sort
Bubble Sort
Insertion Sort
What is the time complexity of merge sort?
O(n)
O(n^2)
O(n log n)
O(log n)
Which data structure is used to implement a priority queue?
Stack
Linked List
Array
Heap
What is the main disadvantage of a linked list?
No direct access to elements
Dynamic size
Faster access time
Easier to implement
Which of the following is a characteristic of a binary search tree?
Each node has two children
The left child is always less than the parent
The right child is always greater than the parent
All of the above
What is the primary purpose of a queue?
To create a binary tree
To implement a stack
To allow elements to be processed in order
To store elements in a sorted order
Which of the following is a characteristic of a min-heap?
The parent node is always greater than its children
The parent node is always less than its children
It is a complete binary tree
Both b and c
What is the time complexity of searching in a hash table?
O(1)
O(log n)
O(n)
O(n log n)
Which of the following is NOT a characteristic of a tree?
It can have leaf nodes
It has a root node
It has a linear structure
It has child nodes
What is the main purpose of a binary tree?
To create a hash table
To implement a stack
To allow fast data retrieval
To store data in a sorted manner
Which of the following is a characteristic of a circular linked list?
The last node points to the first node
The last node points to NULL
It is a linear data structure
Both b and c
What is the time complexity of depth-first search?
O(n)
O(n^2)
O(n log n)
O(log n)
Which of the following is a characteristic of a queue?
Elements are added at the back
Elements are added at the front
Elements are removed from the front
Elements are removed from the back
What is the primary use of a stack?
To store elements in a sorted order
To allow elements to be processed in order
To create a binary tree
To implement a last-in, first-out structure
Which of the following is a characteristic of a doubly linked list?
Both b and c
It is a linear data structure
Each node has two pointers
Each node has one pointer
What is the time complexity of breadth-first search?
O(n)
O(n log n)
O(n^2)
O(log n)
Which of the following is NOT a type of tree?
Circular Tree
Binary Search Tree
AVL Tree
Binary Tree
What is the main purpose of the Quick Sort algorithm?
To merge two sorted arrays
To sort an array by partitioning it
To search for an element in a sorted array
To find the maximum element in an array
In Quick Sort, what is the role of the pivot?
To divide the array into two halves
To determine the final position of elements
To sort the elements in ascending order
To find the median of the array
What is the time complexity of Merge Sort in the average case?
O(n^2)
O(log n)
O(n log n)
O(n)
Which of the following is a characteristic of a Binary Search Tree (BST)?
All nodes have the same value
The left subtree contains only nodes with values greater than the root
Each node has at most two children
The right subtree contains only nodes with values less than the root
What is the maximum height of an AVL tree with n nodes?
O(1)
O(n log n)
O(n)
O(log n)
In a B-tree of order m, what is the minimum number of keys in a non-root internal node?
m-1
m/2
1
m
What is the primary advantage of using a hash table?
Easier implementation
Better sorting capabilities
Lower memory usage
Faster search times
Which of the following is NOT a method for collision resolution in hash tables?
Binary search
Rehashing
Chaining
Open addressing
What is the main purpose of a skip list?
To store data in a sorted manner
To allow for fast search operations
To create a binary tree structure
To implement a priority queue
In a complete binary tree, how many nodes are there at level l?
l
2^l
2^(l+1)
2^l - 1
What is the balance factor of a node in an AVL tree?
Number of children in left subtree - number of children in right subtree
Height of left subtree - height of right subtree
Height of right subtree - height of left subtree
Total number of nodes in the tree
Which of the following sorting algorithms has the worst-case time complexity of O(n^2)?
Heap Sort
Bubble Sort
Merge Sort
Quick Sort
What is the primary characteristic of a threaded binary tree?
It has no null pointers
It allows for faster in-order traversal
It is always balanced
It can have more than two children
In a hash table, what is a synonym?
A key that maps to the same index
A key that is unique
A key that is deleted
A key that is not found
What is the main advantage of using a B+ tree over a B tree?
B+ trees can have more children
B+ trees are faster for searching
B+ trees do not require balancing
B+ trees use less memory
Which of the following is true about a max heap?
The parent node is always less than its children
All nodes have two children
The tree is always balanced
The parent node is always greater than its children
What is the purpose of the partition operation in Quick Sort?
To merge two sorted arrays
To rearrange elements around the pivot
To count the number of elements
To find the median of the array
In a binary search tree, which traversal method would yield the nodes in sorted order?
In-order
Level-order
Pre-order
Post-order
What is the time complexity of searching for an element in a balanced binary search tree?
O(n)
O(log n)
O(n log n)
O(1)
Which of the following is a property of a B-tree?
It can only have two children per node
It is always a complete tree
It can have a variable number of children
All leaves are at the same level
What is the main disadvantage of using a linked representation for trees?
Wastage of memory
Complex implementation
Slower traversal times
No direct access to nodes
What is the primary function of the merge operation in Merge Sort?
To split the array into sub-arrays
To sort the elements in descending order
To combine two sorted arrays into one
To find the pivot element
In a skip list, what is the purpose of the additional levels?
To store more data
To allow for faster searches
To create a balanced tree
To reduce memory usage
What is the worst-case time complexity of insertion in a hash table using chaining?
O(n)
O(log n)
O(n log n)
O(1)
Which of the following is true about a complete binary tree?
All levels are fully filled except possibly the last
It can have any number of children
It is always balanced
It has a maximum height of n
What is the main purpose of a priority queue?
To store elements in a binary tree
To implement a hash table
To sort elements in ascending order
To manage tasks based on priority
In a B+ tree, where are the data pointers stored?
In both internal and leaf nodes
In a separate structure
In the leaf nodes
In the internal nodes
What is the balance factor of a node in an AVL tree after an insertion?
Always 1
Can be any integer
Always 0
Can be -1, 0, or 1
Which of the following algorithms is NOT a divide and conquer algorithm?
Quick Sort
Binary Search
Merge Sort
Heap Sort
What is the primary characteristic of a max heap?
The root is the largest element
It is a complete binary tree
The root is the smallest element
All leaves are at the same level
Which of the following is true about a hash function?
It must distribute keys uniformly
It must be reversible
It must produce a unique output for every input
It must be a linear function
