WorksheetsData Structures and Algorithms Quiz
Total questions: 50
Worksheet time: 25mins
What is a Data Structure?
A programming language
A way to organize and store data
A computer hardware component
None of the above
Which of the following is an example of an algorithm?
Hash table
Binary Search
Stack
Queue
Which data structure allows O(1) access time?
Linked list
Array
Stack
Queue
In linked lists, what connects nodes together?
Indices
Pointers
Arrays
Variables
Which structure is best for dynamic insertion and deletion?
Array
Linked List
Stack
Hash table
Which linked list allows traversal in both directions?
Singly linked list
Doubly linked list
Circular linked list
Static list
What defines a Circular Linked List?
No NULL pointer
Last node points to first
Random connections
Uses arrays internally
What type of structure is a Stack?
FIFO
LIFO
Random Access
Priority Based
Which structure works on FIFO principle?
Stack
Queue
Array
Tree
Which is used for scheduling printer jobs?
Stack
Queue
Hash Table
Graph
Which data structure is best for undo operations?
Queue
Stack
Array
Graph
Which queue prioritizes elements?
Stack
Priority Queue
Circular Queue
Simple Queue
In a BST, left subtree values are:
Greater
Smaller
Random
Equal
Time complexity for search in balanced BST:
O(n)
O(log n)
O(1)
O(n log n)
Which tree maintains balance using rotations?
BST
AVL Tree
Binary Tree
Trie
Red-Black Trees are used in:
TreeSet in Java
Arrays
Linked Lists
Stack
Graphs are made of:
Nodes and indices
Vertices and Edges
Arrays and Pointers
Trees and Leaves
Which algorithm finds shortest paths in unweighted graphs?
DFS
BFS
Dijkstra
Kruskal
Dijkstra’s algorithm works on:
Unweighted graphs
Weighted graphs
Trees only
Linked lists
Which finds Minimum Spanning Tree?
BFS
Kruskal's Algorithm
DFS
Binary Search
Hash tables store data using:
Trees
Hash functions
Arrays
Linked lists only
Which resolves collision by chaining?
Hash table
Stack
Queue
BST
A trie is used in:
Sorting
Autocomplete
Hashing
Stacks
Heaps are used in:
Priority Queues
Hashing
Graphs
Arrays
Disjoint sets are used in:
BFS
Kruskal’s Algorithm
DFS
Hashing
Merge sort complexity:
O(n)
O(n log n)
O(log n)
O(n^2)
Quick Sort is based on:
BFS
Divide and Conquer
Greedy
DP
Binary search works on:
Any array
Sorted array
Linked list
Stack
Dynamic Programming solves:
Independent subproblems
Overlapping subproblems
Unrelated tasks
Graphs only
Memoization reduces:
Space
Redundant computation
Stack size
Queue size
Sparse matrices are mostly:
Full
Zero elements
Sorted
Hashed
Huffman coding is used for:
Encryption
Compression
Searching
Sorting
Greedy algorithms make:
Global choices
Local optimal choices
Random decisions
Backtracking steps
Backtracking is used in:
Sorting
N-Queens problem
BFS
Hashing
Knapsack is solved using:
BFS
Dynamic Programming
DFS
Stacks
Bellman-Ford handles:
Only positive weights
Negative weights
Trees only
Sparse graphs
Floyd-Warshall finds:
Single pair shortest path
All pairs shortest path
MST
LCS
Topological sorting applies to:
Trees
DAG
Cyclic graphs
Stacks
Prim's algorithm is used for:
Shortest path
Minimum Spanning Tree
Sorting
Searching
A perfect hash function has:
Many collisions
No collisions
Random results
High complexity
Bloom filter may have:
False positives
False negatives
Both
None
B-Trees are used in:
Linked lists
Databases
Arrays
Graphs
Segment trees are used for:
Sorting
Range queries
Hashing
BFS
Fenwick trees help in:
Range updates
Prefix sums
Sorting
Hashing
Longest Common Subsequence (LCS) is used in:
Graphs
DNA alignment
Trees
Hashing
Deque allows insertion from:
Front only
Rear only
Both ends
Middle
Circular queue is used in:
Stack
Traffic light systems
Sorting
Trees
Big O notation gives:
Exact time
Upper bound
Lower bound
Average time
Tail recursion helps in:
Using more stack
Constant stack space
More memory
More recursion depth
Bitmask represents:
Arrays
Subsets
Linked lists
Trees
