NEW
Font size
WorksheetsAlgorithm and Complexity Quiz
Total questions: 27
Worksheet time: 14mins
What notation is used to describe the upper bound of an algorithm's time complexity?
Big-O
Big-Ω
Big-Θ
Little-o
Which algorithm is used for finding the greatest common divisor (GCD)?
Merge sort
Euclidean algorithm
Fibonacci sequence
Sieve of Eratosthenes
What is the primary technique used in the KMP algorithm?
Backtracking
Dynamic programming
Pattern matching
Greedy approach
Which of the following is a divide and conquer algorithm?
Quick sort
Huffman coding
Activity selection
0/1 knapsack
What does the Master Theorem help analyze?
Recurrence relations
Sorting algorithms
Bit manipulation
Graph connectivity
Which of the following is a classical dynamic programming problem?
Merge sort
Longest common subsequence (LCS)
Binary search
Dijkstra's algorithm
What is the main advantage of memoization in dynamic programming?
Eliminates recursion
Simplifies code
Increases space complexity
Reduces time complexity
Which algorithm is used for cycle detection in graphs?
Dijkstra's algorithm
Bellman-Ford
Depth-first search
Merge sort
What is the purpose of backtracking in algorithms?
To sort data efficiently
To explore all possible solutions
To find the shortest path
To optimize space complexity
Which of the following problems is NP-Hard?
Fibonacci sequence
Merge sort
Binary search
0/1 knapsack
What does the term 'greedy-choice property' refer to?
Dividing problems into subproblems
Using dynamic programming
Exploring all possibilities
Choosing the best option at each step
Which algorithm is used for finding the longest palindromic substring?
Binary search
Dynamic programming
Rabin-Karp
KMP
What is the time complexity of merge sort?
O(log n)
O(n log n)
O(n^2)
O(n)
Which of the following is a bit manipulation operation?
Pattern matching
Finding GCD
Sorting an array
AND operation
What is the main goal of the Sieve of Eratosthenes?
Calculating GCD
Sorting numbers
Finding prime numbers
Finding the longest substring
Which algorithm is used for job sequencing?
Divide and conquer
Backtracking
Greedy algorithm
Dynamic programming
What is the primary focus of the Bellman-Ford algorithm?
Sorting data
Finding the shortest path
Finding prime numbers
Searching for elements
Which of the following is a property of NP-Complete problems?
Can be verified in polynomial time
Can be solved in polynomial time
Are always solvable
Always have a unique solution
What is the purpose of the Z-algorithm?
Pattern matching
Sorting
Graph traversal
Dynamic programming
Which of the following is NOT a string algorithm?
KMP
Merge sort
Rabin-Karp
Z-algorithm
What does the term 'asymptotic analysis' refer to?
Analyzing algorithms for large inputs
Finding the best algorithm
Analyzing algorithms for small inputs
Comparing different algorithms
Which of the following is a backtracking problem?
Binary search
Sudoku solver
Fibonacci sequence
Merge sort
What is the main characteristic of a greedy algorithm?
It always finds the optimal solution
It makes the best choice at each step
It uses recursion
It divides problems into subproblems
Which of the following is a method for checking connectivity in graphs?
Depth-first search
Merge sort
Binary search
Dynamic programming
What is the time complexity of the closest pair of points algorithm?
O(n^2)
O(log n)
O(n)
O(n log n)
Which of the following is a property of the 0/1 knapsack problem?
Can take only whole items
Is always solvable
Can take multiple items
Can take fractional items
What is the main purpose of the Trie data structure?
Sorting data
Searching for strings
Finding prime numbers
Graph traversal
