click below
click below
Normal Size Small Size show me how
ALGO- Module 3 and 4
| Question | Answer |
|---|---|
| ______ is an algorithm compares the pattern to the text, one character at a time, until un-matching characters are found: Group of answer choices Divide and conquer Dynamic programming Transform and conquer Brute force | Brute force |
| It’s a sorting algorithm that sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning Group of answer choices Selection Merge Bubble Quick | Selection Sort |
| What is the time efficiency of the brute force string match? Group of answer choices O(mn) O(1) exponential (nm2) | O(mn) |
| In the given code snippet below, pseudocode of brute force string, what does m represents? for i ← to n-m do j ← 0 while j<m and P[j} = T[i+j] do _________ if j=m return i __________ | characters representing a pattern |
| Given the text pattern, Find the first index in the pattern Text: A A B A A C A A D A A B A A B A Pattern: A A B A 15 12 9 0 | 0 |
| Given input string = “THIS IS A TEST TEXT” and pattern string = “TEXT”. Find the first index of the pattern match using quick search algorithm Group of answer choices 14 16 17 15 | 15 |
| Given input string = “ABCDABCATRYCARCABCSRT” and pattern string = “CAT”. Find the first index of the pattern match using quick search algorithm Group of answer choices 11 2 14 6 | 6 |
| An algorithm that calculate the total distance for every possible route and then select the shortest one. Group of answer choices Greedy Dynamic Programming Exhaustive Search Divide and Conquer | Exhaustive Search |
| There are how many steps in writing the brute force string matching algorithm 5 6 3 4 | 3 |
| It finds the location of a specific text pattern within a larger body of text? seeking Brute force pattern matching string search | string search |
| A process there it involves searching for an element with a special property, usually among combinatorial objects such as permutations, combinations, or subsets of a set. Dynamic programming Brute force Divide and Conquer Traveling Salesman | Brute force |
| You are given a knapsack that can carry a maximum weight of 60. There are 4 items with weights {20, 30, 40, 70} and values {70, 80, 90, 200}. What is the maximum value of the items you can carry using the knapsack? 90 160 170 200 | 160 |
| What is the time complexity of the brute force algorithm used to solve the Knapsack problem? Group of answer choices O(2^n) Exponential O(n) O(1) | O(2^n) |
| It derives its name from the problem faced by someone who is constrained by a fixed-size backpack and must fill it with the most valuable items. Traveling Salesman Knapsack problem Dynamic programming Brute force | Knapsack problem |
| According to the Stony Brook University Algorithm Repository, what is the ranked of the knapsack problem? 19th 20th 17th 18th | 19th |
| The Knapsack problem is an example of ____________ Divide and Conquer Greedy Brute Force Transform and conquer | Brute force |
| Given the text pattern, how many match can you derived from it? Text: A A B A A C A A D A A B A A B A Pattern: A A B A 2 3 4 0 | 3 |
| Which is an advantage of using a brute force from the following list? It yields ѕtаndаrd аlgоrіthmѕ fоr simple соmрutаtіоnаl tasks, It rаrеlу уіеldѕ еffісіеnt аlgоrіthmѕ | It yields ѕtаndаrd аlgоrіthmѕ fоr simple соmрutаtіоnаl tasks, |
| There are how many steps in the selection sort algorithm 5 6 7 4 | 5 |
| Refers to a string of M characters to search for text string matching pattern string | Pattern |
| It finds the location of a specific text pattern within a larger body of text? Group of answer choices Brute force seeking string search pattern matching | string search |
| Compares a given pattern with all substrings of a given text. Brute force Brute force string matching selection sort None of the above | Brute force string matching |
| How many sub-arrays does selection sort maintains? 5 4 2 3 | 2 |
| An algorithm that calculate the total distance for every possible route and then select the shortest one. Dynamic Programming Greedy Exhaustive Search Divide and Conquer | Exhaustive Search |
| Given the text pattern, What is the index of the second pattern Text: A A B A A C A A D A A B A A B A Pattern: A A B A 9 10 12 13 | 9 |
| What is the time complexity of the brute force algorithm used to solve the Knapsack problem? Group of answer choices O(n) Exponential O(2^n) O(1) | O(2^n) |
| The 0-1 Knapsack problem can be solved using Greedy algorithm True False | True (dapat false to) |
| This approach is an example of combinatorial optimization. Dynamic programming Traveling Salesman Brute force Knapsack problem | Knapsack problem |
| In the travelling salesman problem, what do you call the stating point? Starting point Top Vertex Edge | Vertex |
| The main challenge of the traveling salesman is? maximize the cost minimize travel None tour cities | minimize travel |
| What is the auxiliary space complexity of merge sort? O(n log n) O(1) O(n) Exponential | O(n) |
| Which of the following method is used for sorting in merge sort? D exchanging merging selection partitioning | merging |
| What is the time complexity of quick sort for worse case? O (n^2) O (1) Exponential O (n log n) | O (n^2) |
| A binary search is to be performed on the list: 3 5 9 10 123 How many comparisons would it take to find number 9? 2-3 6-7 4-5 0-1 | 0-1 |
| What do you call a sorting algorithm that partitions an array and then calls itself recursively twice to sort the two resulting subarrays. Group of answer choices Insertion Sort Bubble Sort Quick Sort Merge Sort | Quick sort |
| Select the best description to explain what a binary search algorithm is Put the elements in order, compare with the middle value, split the list in order and repeat Elements do not need to be in order, check each item in turn. | Put the elements in order, compare with the middle value, split the list in order and repeat |
| Merge Sort can be categorized into which of the following? Decrease and Conquer Divide and Conquer Dynamic Programming Greedy Algorithm | Divide and Conquer |
| What do you call the step in the Divide and conquer approach that involves breaking the problem into smaller sub-problems? Group of answer choices Collapse Halt Breakdown | Break |
| Describe an advantage of a binary search algorithm Can only work on an ordered list. If unordered must use a linear search. Data does not need to be in order. Performs well over large ordered lists. Slow with large data sets. | Performs well over large ordered lists. |
| What is the time complexity of closest pair O(n!) O(1) O(n log n) Exponential | O(n log n) |
| What is the running time of naïve matrix multiplication algorithm? O(n^2.8074) O(n^4) O(n) O(n^3) | O(n^3) |
| What is the worse time complexity of Strassen algorithm O(n^3.8974) O(n^2.8074) O(n^3.8074) O(n^2.8974) | O(n^2.8074) |
| There are a total of _______ sub-matrices in solving for the Strassen algorithm 8 6 9 7 | 8 |
| A method that compute its problem of computational geometry. Strassen Algo Merge sort Closest Pair Binary Search | Closest Pair |
| There are how many steps in the closest pair algorithm? 6 7 8 9 | 7 |
| What was the algorithm that Strassen algorithm was compared which resulted to a faster matrix multiplication? Coppersmith algorithm Copper Winograd algorithm Coppersmith-Winograd algorithm Smith-Winograd algorithm | Coppersmith-Winograd algorithm |
| The Strassen algorithm is known as a? Matrix multiplication Matrix subtraction Matrix Addition Matrix Division | Matrix multiplication |
| Strassen’s algorithm is a/an_____________ algorithm. Approximation Accurate Non-recursive Recursive | Recursive |
| What is the optimal time required for solving the closest pair problem using divide and conquer approach? O(1) O(n log n) O(n!) Exponential | O(n log n) |