What is a brute-force approach in algorithm design?
Group of answer choices
A method that uses advanced techniques to solve problems efficiently
A straightforward approach based directly on the problem’s statement and definitions
A technique that avoids generating all potential solutions
A method that relies solely on machine learning algorithms
A straightforward approach based directly on the problem’s statement and definitions
Which of the following is NOT a strength of brute-force algorithms?
Group of answer choices
Wide applicability
Simplicity
High efficiency
Reasonable algorithms for some important problems
High efficiency
What is the primary goal of selection sort?
Group of answer choices
To repeatedly find the maximum element and place it at the end
To repeatedly find the minimum element and place it at the beginning
To divide the array into two equal halves
To compare adjacent elements and swap them
To repeatedly find the minimum element and place it at the beginning
In selection sort, how many subarrays are maintained during the sorting process?
Group of answer choices
Two (sorted and unsorted)
Three (sorted, unsorted, and temporary)
One (entire array)
Four (sorted, unsorted, temporary, and pivot)
Two (sorted and unsorted)
What is the time complexity of brute-force string matching in the worst case?
Group of answer choices
Θ(n + m)
Θ(n log m)
Θ(mn)
Θ(n^2)
Θ(mn)
What is exhaustive search primarily used for?
Group of answer choices
Solving problems using dynamic programming
Generating all potential solutions to a problem systematically
Reducing the problem size by half
Finding approximate solutions
Generating all potential solutions to a problem systematically
Which step aligns the pattern at the beginning of the text in brute-force string matching?
Group of answer choices
Step 1
Step 2
Step 3
Step 4
Step 1
Which problem involves finding the shortest tour that passes through all cities exactly once?
Group of answer choices
Knapsack Problem
Traveling Salesman Problem
Selection Sort Problem
String Matching Problem
Traveling Salesman Problem
hat is the total cost of the tour a→b→c→d→a in the Traveling Salesman Problem example?
Group of answer choices
21
17
20
15
17
Which algorithm is commonly used as a heuristic for solving the Traveling Salesman Problem?
Group of answer choices
Selection Sort Algorithm
Brute-Force String Matching Algorithm
Nearest Neighbor Algorithm
Exhaustive Search Algorithm
Nearest Neighbor Algorithm
What is the knapsack capacity in the given example of the Knapsack Problem?
Group of answer choices
10
12
16
20
16
Which subset has the highest total value without exceeding the knapsack capacity in the example?
Group of answer choices
{1, 2, 3}
{1, 3, 4}
{2, 3}
{1, 2, 4}
{2, 3}
What is the efficiency of the exhaustive search approach for the Knapsack Problem?
Group of answer choices
Θ(n log n)
Θ(n^2)
Θ(2^n)
Θ(n!)
Θ(2^n)
Which of the following is true about brute-force algorithms?
Group of answer choices
They are always efficient
They rarely yield efficient algorithms
They are the most constructive design techniques
They avoid comparing all possible solutions
They rarely yield efficient algorithms
In the Traveling Salesman Problem, what does a Hamiltonian circuit represent?
Group of answer choices
A path that visits some cities exactly once
A path that visits all cities exactly once and returns to the starting city
A path that visits all cities multiple times
A path that skips one city
A path that visits all cities exactly once and returns to the starting city
What is the first step in the Nearest Neighbor Algorithm for TSP?
Group of answer choices
Choose a starting vertex
Calculate the total cost of the tour
List all possible tours
Compare edge weights
Choose a starting vertex
Which of the following is NOT a combinatorial object?
Group of answer choices
Permutations
Combinations
Matrices
Subsets
Matrices
What is the output of the brute-force string matching algorithm if no match is found?
Group of answer choices
0
The length of the pattern
-1
The length of the text
-1
What does row minimization achieve in the Traveling Salesman Problem?
Group of answer choices
It reduces the number of vertices
It simplifies the matrix by subtracting the smallest value in each row
It eliminates all zeros in the matrix
It calculates the total cost of the tour
It simplifies the matrix by subtracting the smallest value in each row
Which of the following is a weakness of brute-force algorithms?
Group of answer choices
Limited applicability
Complexity in implementation
Some brute-force algorithms are unacceptably slow
Lack of systematic approach
Some brute-force algorithms are unacceptably slow
What is the main idea behind the Divide and Conquer algorithm?
Group of answer choices
Dividing a problem into smaller sub-problems, solving them independently, and combining their solutions
Solving problems using brute force
Using dynamic programming to solve problems
Solving problems iteratively without recursion
Dividing a problem into smaller sub-problems, solving them independently, and combining their solutions
Which sorting algorithm uses the Divide and Conquer approach?
Group of answer choices
Bubble Sort
Merge Sort
Selection Sort
Insertion Sort
Merge Sort
In Merge Sort, what is the first step?
Group of answer choices
Divide the array into equal halves until atomic values are achieved
Combine the sorted halves
Swap elements in the array
Compare elements from both halves
Divide the array into equal halves until atomic values are achieved
What is the time complexity of Merge Sort in the worst case?
Group of answer choices
O(n log n)
O(n^2)
O(log n)
O(n)
O(n log n)