CS502 – Fundamentals of Algorithms: Midterm Important MCQs (239 Solved Questions)
Computer Science • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · CS502 Course Page · CS502 Subjective Pack (39 Q&As)
-
Unlike programs, algorithms are to be understood primarily by _____________ and ____________
Topic: Algorithm Basics & History
- Machines, not people
- Mathematical expressions, not algebraic expressions
- Programmers, not machines ✓ Correct answer
- RAM, not programmer
-
Al-Khwarizmi's work was written in a book titled ____________________
Topic: Algorithm Basics & History
- al Kitab al-mukhatasar fi hisab al-jabrwa'l-muqabalah ✓ Correct answer
- Calculation by Completion
- al Kitab
- al-jabrwa'l-muqabalah
-
The word Algorithm comes from the name of the Muslim author __________________
Topic: Algorithm Basics & History
- Abu Ja'far Mohammad ibn Musa al-Khowarizmi or Al-Khwarizmi ✓ Correct answer
- Khwarizm
- Kheva
- Uzbekistan
-
__________________ is a graphical representation of an algorithm
Topic: Algorithm Basics & History
- Σ notation
- Θ notation
- Flowchart ✓ Correct answer
- Asymptotic notation
-
Algorithm's essential elements are
Topic: Algorithm Basics & History
- Step wise solution
- Stepwise solution and finite time ✓ Correct answer
- Step wise solution finite inputs
- Stepwise approach in which time and memory does not matter
-
In Random Access Machine, instructions are executed _________________
Topic: Algorithm Basics & History
- Five at a time
- Infinite instructions at a time
- One-by-one ✓ Correct answer
- Parallel
-
Which type of instructions can a Random Access Machine (RAM) execute? Choose the best answer
Topic: Algorithm Basics & History
- Algebraic and logic
- Geometric and arithmetic
- Arithmetic and logic ✓ Correct answer
- Parallel and recursive
-
Computational model of sequential RAM is:
Topic: Algorithm Basics & History
- Parallel machines may be expensive to model and have more computational power than sequential RAM
- Computational power of sequential RAM is same as that of parallel machines, only time efficiency is achieved with parallel machines
- Both first and second options are true for the statement
- Less powerful computational wise than parallel machines ✓ Correct answer
-
Recurrences are useful for analyzing
Topic: Complexity Analysis & Recurrences
- Recursive Algorithms ✓ Correct answer
- Simple Algorithms
- Parallel Algorithms
- Parallel Algorithms & Recursive Algorithms
-
Which of the following is calculated with Big O notation?
Topic: Complexity Analysis & Recurrences
- Medium bounds
- Lower bounds
- Upper bounds ✓ Correct answer
- Both upper and lower bound
-
Which of the following is calculated with Big Theta notation?
Topic: Complexity Analysis & Recurrences
- Lower bounds
- Upper bounds
- Both upper and lower bound ✓ Correct answer
- Medium bounds
-
What is the asymptotic growth of (4n^3 + 15n^2 + 11n) / 6 ?
Topic: Complexity Analysis & Recurrences
- Θ((4n^3 + 15n^2 + 11n) / 6)
- Θ(4n^3 + 15n^2 + 11n)
- Θ(15n^2)
- Θ(n^3) ✓ Correct answer
-
What is the asymptotic growth of n^2 + (4n + 15n + 11n) / 16 ?
Topic: Complexity Analysis & Recurrences
- Θ((4n + 15n + 11n) / 16)
- Θ(n^2 + n + 1/16)
- Θ(n^2) ✓ Correct answer
- Θ(n)
-
Which of the following functions grows fastest as n gets larger?
Topic: Complexity Analysis & Recurrences
- n^10 · 2^n
- n^8 · 3^n
- n^5 · 5^n ✓ Correct answer
- n^3 · 2^2n
-
Suppose we have an algorithm that carries out N^2 operations for an input of size N. A computer takes 1 microsecond (1/1000000 second) to carry out one operation. How long does the algorithm run for an input of size 3000?
Topic: Complexity Analysis & Recurrences
- 90 seconds
- 9 seconds ✓ Correct answer
- 0.9 seconds
- 0.09 seconds
-
Which one is the best algorithm from the following with respect to running time?
Topic: Complexity Analysis & Recurrences
- Θ(n) ✓ Correct answer
- Θ(n^2)
- Θ(n log n)
- Θ(n^3)
-
Which one is the correct conversion of the MAXIMA algorithm (int n, Point P[1...n]) to sigma notation?
Topic: Complexity Analysis & Recurrences
- Σ (i=1 to n) 4n + 4
- Σ (i=1 to n) 4n + 2 ✓ Correct answer
- Σ (i=1 to n) 4n + 2n
- Σ (i=1 to n) 2n + 2
-
The worst case running time of the MAXIMA algorithm given below is: MAXIMA(int n, Point P[1...n]) — for i ← 1 to n do maximal ← true; for j ← 1 to n do if (i ≠ j) and (P[i].x ≤ P[j].x) and (P[i].y ≤ P[j].y) then maximal ← false, break; if maximal then output P[i]
Topic: Complexity Analysis & Recurrences
- Θ(n^6)
- Θ(2n / n^6)
- Θ(n^2) ✓ Correct answer
- Θ(2n lg 6)
-
What is the solution to the recurrence T(n) = T(n/2) + n, T(1) = 1 ?
Topic: Complexity Analysis & Recurrences
- O(log n)
- O(n) ✓ Correct answer
- O(n log n)
- O(n^2)
-
The recurrence relation of Tower of Hanoi is T(n) = 1 if n = 1; T(n) = 2T(n-1) + 1 if n > 1. In order to move a tower of 4 rings from one peg to another, how many ring moves are required?
Topic: Complexity Analysis & Recurrences
- 15 ✓ Correct answer
- 7
- 12
- 32
-
Divide-and-conquer involves breaking the problem into a small number of
Topic: Sorting & Divide and Conquer
- Pivot
- Sub problems ✓ Correct answer
- Selection
- Sieve
-
In which order can we sort?
Topic: Sorting & Divide and Conquer
- Increasing order or decreasing order ✓ Correct answer
- Both at the same time
- Increasing order only
- Decreasing order only
-
Comparison based sorting algorithms can not run faster than
Topic: Sorting & Divide and Conquer
- Ω(n log n) ✓ Correct answer
- O(n log n)
- Ω(n^2)
- O(n^2)
-
In Quick sort, we don't have control over the sizes of recursive calls
Topic: Sorting & Divide and Conquer
- True ✓ Correct answer
- False
- Less information to decide
- Either true or false
-
Who invented the Quick sort procedure?
Topic: Sorting & Divide and Conquer
- Hoare ✓ Correct answer
- Sedgewick
- Mellroy
- Coreman
-
Strictly increasing arrays are ________________ input for quick sort
Topic: Sorting & Divide and Conquer
- The worst-case ✓ Correct answer
- The best-case
- Average case
- None of the given
-
The running time of quick sort depends heavily on the selection of
Topic: Sorting & Divide and Conquer
- Required Output
- Input and output
- Pivot ✓ Correct answer
- Input data only
-
Quick sort is based on the divide and conquer paradigm. In the Combine step of the divide and conquer process
Topic: Sorting & Divide and Conquer
- No work is needed to combine the sub-arrays, the array is already sorted ✓ Correct answer
- Work is needed to combine the sub-arrays; the array is not already sorted
- Merging the Arrays
- Dividing the arrays
-
After partitioning the array in Quick sort, the pivot is placed in a position such that
Topic: Sorting & Divide and Conquer
- Values smaller than pivot are on left and larger than pivot are on right ✓ Correct answer
- Values larger than pivot are on left and smaller than pivot are on right
- Pivot is the first element of array
- Pivot is the last element of array
-
An in-place sorting algorithm is one that uses no ________________ arrays for storage
Topic: Sorting & Divide and Conquer
- Two dimensional
- Three dimensional
- n dimensional
- Additional ✓ Correct answer
-
Bubble sort and insertion sort can be implemented as stable algorithms but __________ can not be
Topic: Sorting & Divide and Conquer
- Selection sort ✓ Correct answer
- Bubble sort
- Merge sort
- Stable sort
-
Counting sort assumes that the numbers to be sorted are in the range 1 to k, where k is
Topic: Sorting & Divide and Conquer
- Small ✓ Correct answer
- Large
- No restriction on k
- None of these
-
_______ overcomes the limitations of ________ by working as per positional notations of numbers
Topic: Sorting & Divide and Conquer
- Counting sort, Radix sort
- Radix sort, Counting sort ✓ Correct answer
- Radix sort, Bubble sort
- Bubble sort, Radix sort
-
What is the total time to heapify?
Topic: Sorting & Divide and Conquer
- O(log n) ✓ Correct answer
- O(n log n)
- O(n^2 log n)
- O(log^2 n)
-
What is the correct order of operations in merge sort?
Topic: Sorting & Divide and Conquer
- Conquer → Divide → Combine
- Divide → Conquer → Combine ✓ Correct answer
- Conquer → Divide → Split
- Split → Conquer → Destroy
-
What is the average-case time for merge sort to sort an array of n elements?
Topic: Sorting & Divide and Conquer
- O(log n)
- O(n)
- O(n log n) ✓ Correct answer
- O(n^2)
-
In Sieve Technique, we know __________
Topic: Sieve Technique & Selection
- Item of interest ✓ Correct answer
- Order of items
- Complexity of items
- All items are of interest
-
The reason for introducing the Sieve Technique algorithm is that it illustrates a very important special case of
Topic: Sieve Technique & Selection
- Divide-and-conquer ✓ Correct answer
- Decrease and conquer
- Greedy nature
- 2-dimension Maxima
-
The sieve technique is a special case, where the number of sub problems is just
Topic: Sieve Technique & Selection
- 5
- Many
- 1 ✓ Correct answer
- Few
-
When a recursive algorithm revisits the same problem over and over again, we say that the optimization problem has ___________________ sub-problems
Topic: Dynamic Programming & Matrix Chain
- Overlapping ✓ Correct answer
- Over costing
- Optimized
- None of these
-
Memoization is a process
Topic: Dynamic Programming & Matrix Chain
- To avoid unnecessary repetitions by writing down the results of recursive calls and looking them up again if needed later ✓ Correct answer
- To avoid repeated data by writing down the results of input array and looking them up again if needed later
- None of these
- All options are correct
-
A problem exhibits ______________ if an optimal solution to the problem contains within it optimal solutions to sub-problems
Topic: Dynamic Programming & Matrix Chain
- Optimal structure ✓ Correct answer
- Efficient structure
- Inefficient structure
- Unknown behavior
-
Memoization is a part of ________ programming strategy
Topic: Dynamic Programming & Matrix Chain
- Memory
- Fast
- Dynamic ✓ Correct answer
- Slow
-
Dynamic Programming algorithms often use some kind of ____________ to store the results of intermediate sub-problems
Topic: Dynamic Programming & Matrix Chain
- Loop
- Table ✓ Correct answer
- Variable
- Stack
-
If there are Θ(n^2) entries in the edit distance matrix then the total running time is
Topic: Dynamic Programming & Matrix Chain
- Θ(1)
- Θ(n^2) ✓ Correct answer
- Θ(n)
- Θ(n log n)
-
There are __________ entries in the Edit Distance Matrix
Topic: Dynamic Programming & Matrix Chain
- Θ(n+2)
- Θ(n)
- Θ(n + 100)
- Θ(n^2) ✓ Correct answer
-
The only way to convert an empty string into a string of j characters is by doing j insertions, represented as ____________
Topic: Dynamic Programming & Matrix Chain
- E(0, j) = j ✓ Correct answer
- E(i, 0) = i
- E(1, j) = j
- E(i, j) = I
-
A p × q matrix A can be multiplied with a q × r matrix B. The result will be a p × r matrix C. In particular, for 1 ≤ i ≤ p and 1 ≤ j ≤ r,
Topic: Dynamic Programming & Matrix Chain
- C[i, j] = Σ (k=1 to q) A[i, k] B[k, j] ✓ Correct answer
- C[i, j] = Σ (k=1 to q) A[k, i] B[k, j]
- C[i, j] = Σ (k=1 to q) A[k, i] B[j, k]
- None of these
-
We can find the product A × B of matrices A and B only if they are compatible, which means
Topic: Dynamic Programming & Matrix Chain
- No of Columns of A must be equal to No of Rows of B ✓ Correct answer
- No of Columns of A must be equal to No of Columns of B
- No of Rows of A must be equal to No of Rows of B
- Order of A must be equal to order of B
-
If matrix A of dimension p × q is multiplied with matrix B of dimension q × r, then the dimension of the resultant matrix is
Topic: Dynamic Programming & Matrix Chain
- p × q
- p × r ✓ Correct answer
- q × r
- r × p
-
A p × q matrix A can be multiplied with a q × r matrix B. The result will be a p × r matrix C. There are (p · r) total entries in C and each takes __________ to compute
Topic: Dynamic Programming & Matrix Chain
- O(q) ✓ Correct answer
- O(1)
- O(n^2)
- O(n^3)
-
Time complexity of chain matrix multiplication is Θ(n^3) and space complexity is
Topic: Dynamic Programming & Matrix Chain
- Θ(n^2) ✓ Correct answer
- Θ(n^3)
- Θ(n log n)
- Θ(log n)
-
Matrix-Chain-Order is ______________ than the exponential time method of enumerating all possible parenthesizations and checking each one
Topic: Dynamic Programming & Matrix Chain
- Much more efficient ✓ Correct answer
- Only fractional efficient
- Worst
- Too slow
-
For Chain Matrix Multiplication we can not use the divide and conquer approach because
Topic: Dynamic Programming & Matrix Chain
- We do not know the optimum k ✓ Correct answer
- We use divide and conquer for sorting only
- We can easily perform it in linear time
- Size of data is not given
-
In chain matrix multiplication, the table is filled ______ to find the multiplication of matrices
Topic: Dynamic Programming & Matrix Chain
- Row wise
- Diagonally ✓ Correct answer
- Bottom-to-up
- Column wise
-
Catalan number is given by the formula
Topic: Dynamic Programming & Matrix Chain
- C(n) = 1/(n+1) × (2n choose n) ✓ Correct answer
- C(n) = 1/(n-1) × (2n choose n)
- C(n) = 1/(n+1) × (n choose 2n)
- C(n) = 1/(n-1) × (n choose 2n)
-
Catalan numbers are related to the number of different ______ on 'n' nodes
Topic: Dynamic Programming & Matrix Chain
- Binary trees ✓ Correct answer
- Linked lists
- Functions
- Arrays
-
The Knapsack problem belongs to the domain of ___________________ problems
Topic: Dynamic Programming & Matrix Chain
- Optimization ✓ Correct answer
- NP Complete
- Linear Solution
- Sorting
-
Random access machine or RAM is a/an
Topic: Algorithm Basics & History
- Machine build by Al-Khwarizmi
- Mechanical machine
- Electronics machine
- Mathematical model ✓ Correct answer
-
_________ is a method of solving a problem in which we check all possible solutions to the problem to find the solution we need.
Topic: Algorithm Basics & History
- Plane-Sweep Algorithm
- Sorting Algorithm
- Brute-Force Algorithm ✓ Correct answer
- Greedy approach
-
Al-Khwarizmi was a/an _______
Topic: Algorithm Basics & History
- Artist
- Mathematician ✓ Correct answer
- Astronomer
- Khalifah
-
Pseudo code of algorithms are to be read by _______.
Topic: Algorithm Basics & History
- People ✓ Correct answer
- RAM
- Computer
- Compiler
-
In order to say anything meaningful about our algorithms, it will be important for us to settle on a ______.
Topic: Algorithm Basics & History
- Java Program
- C++ Program
- Pseudo program
- Mathematical model of computation ✓ Correct answer
-
In Fibonacci sequence, each term is calculated by____ previous__ terms.
Topic: Algorithm Basics & History
- Subtracting, Two
- Adding, Three
- Adding, Two ✓ Correct answer
- Multiplying, Two
-
Fibonacci Sequence was named on ______, a famous mathematician in 12th Century.
Topic: Algorithm Basics & History
- Fred Brooks
- Grady Booch
- Leonardo Pisano ✓ Correct answer
- Edgar F. Codd
-
______ is not a characteristic of Random Access Machine.
Topic: Algorithm Basics & History
- Single-Processor
- Assigning a value to a variable
- Locality of reference ✓ Correct answer
- Executing an arithmetic instruction
-
Using _______ algorithm, efficiency is not given much importance
Topic: Algorithm Basics & History
- Greedy
- Merge sort
- Processing as there is no algorithm by this name
- Brute Force ✓ Correct answer
-
The following sequence is called ____________ 1,2,3,5,8,13,21,34,55,…..
Topic: Algorithm Basics & History
- Optimize sequence
- Fibonacci sequence ✓ Correct answer
- Optimal sequence
- Overlapping sequence
-
The problem with the brute-force algorithm is that is uses ________ in pruning out de
Topic: Algorithm Basics & History
- Worst-case time
- No intelligence ✓ Correct answer
- Outside looping
- Artificial intelligence
-
An algorithm is said to be correct if for every ______ instance, it halts with the correct ______.
Topic: Algorithm Basics & History
- Input, Output ✓ Correct answer
- Design, Analysis
- Value, Key
- Key, Analysis
-
In RAM model instructions are executed
Topic: Algorithm Basics & History
- One after another ✓ Correct answer
- Parallel
- Concurrent
- Random
-
An algorithm is a mathematical entity that is dependent on a specific programming language.
Topic: Algorithm Basics & History
- True
- False ✓ Correct answer
-
An algorithm is a mathematical entity. Which is independent of ____.
Topic: Algorithm Basics & History
- Programming language
- Machine and Programming language
- Compiler and Programming language
- Programing Language Compiler and Machine ✓ Correct answer
-
An _________ is thus a sequence of computational steps that transform the input into output.___
Topic: Algorithm Basics & History
- Data Structure
- Data Process
- Algorithm ✓ Correct answer
- none
-
The definition of Theta-notation relies on proving ___________asymptotic bound.
Topic: Complexity Analysis & Recurrences
- One
- Lower
- Upper
- Both lower & upper bounds ✓ Correct answer
-
Efficient algorithm requires less computational...
Topic: Complexity Analysis & Recurrences
- Memory
- Running Time
- Memory and Running Time ✓ Correct answer
- Energy
-
F (n) and g (n) are asymptotically equivalent. This means that they have essentially the same __________ for large n.
Topic: Complexity Analysis & Recurrences
- Results
- Variables
- Size
- Growth rates ✓ Correct answer
-
The function f(n)=n(logn+1)/2 is asymptotically equivalent to nlog n. Here Lower Bound means function f(n) grows asymptotically at ____________ as fast as nlog n.
Topic: Complexity Analysis & Recurrences
- Normal
- Least ✓ Correct answer
- Most
- All
-
The time assumed for each basic operation to execute on RAM model of computation is-----
Topic: Complexity Analysis & Recurrences
- Infinite
- Continuous
- Constant ✓ Correct answer
- Variable
-
Consider the following Algorithm: Factorial (n){ if (n=1) return 1 else return (n * Factorial(n-1)) } Recurrence for the following algorithm is:
Topic: Complexity Analysis & Recurrences
- T(n) = T(n-1) +1 ✓ Correct answer
- T(n) = nT(n-1) +1
- T(n)= T(n-1) +n
- T(n)=T(n(n-1)) +1
-
Consider the following code: for (j=1; j<n; j++) for (k=1; k<15; k++) for (l=5; l<n; l++) { Do_something_constant(); } What is the order of execution (running time) for this code?
Topic: Complexity Analysis & Recurrences
- O(n)
- O(n^3)
- O(n^2 log n)
- O(n^2) ✓ Correct answer
-
In asymptotical analysis of n(n-3) and 4n*n, as n becomes large, the dominant (fastest growing) term is some constant times _______.
Topic: Complexity Analysis & Recurrences
- n+1
- n-1
- n
- n*n ✓ Correct answer
-
Result of asymptotical analysis of n(n -3) and 4n*n is that _______
Topic: Complexity Analysis & Recurrences
- n(n-1) is asymptotically Less
- n(n-1) is asymptotically Greater
- Both are asymptotically Not equivalent
- Both are asymptotically Equivalent ✓ Correct answer
-
_____ time is the maximum running time over all legal inputs.
Topic: Complexity Analysis & Recurrences
- Worst-case ✓ Correct answer
- Average-case
- Best-case
- Good-case
-
The Iteration method is used for ______
Topic: Complexity Analysis & Recurrences
- Comparing sorting algorithms only
- Solving Recurrence relations ✓ Correct answer
- Merging elements in Merge sort
- Dividing elements in Merge sort
-
The Omega-notation allows us to state only the asymptotic ______ bounds.
Topic: Complexity Analysis & Recurrences
- Middle
- Lower ✓ Correct answer
- Upper
- Both lower & upper
-
The asymptotic growth of n(n+1)/2 is:
Topic: Complexity Analysis & Recurrences
- O(n^2) ✓ Correct answer
- O(n)
- O(n+2)
- O(n log n)
-
In the following code the statement “cout<<j;”executes ---- ----- times. for (j=1; j<=5; j = j+2) cout<<j;
Topic: Complexity Analysis & Recurrences
- 5 times
- 2 times
- 3 times ✓ Correct answer
- 0 times
-
For _________ values of n, any algorithm is fast enough.
Topic: Complexity Analysis & Recurrences
- Small ✓ Correct answer
- Medium
- Large
- Infinity
-
Asymptotic growth rate of the function is taken over ______ case running time. .
Topic: Complexity Analysis & Recurrences
- Best
- Worst ✓ Correct answer
- Average
- Normal
-
Cubic function will ________ a quadratic function.
Topic: Complexity Analysis & Recurrences
- Prove
- be equal to
- overtake ✓ Correct answer
- find
-
Asymptotic growth of 8n^2 + 2n – 3 is:
Topic: Complexity Analysis & Recurrences
- Θ(n^2 + n)
- Θ (n^2) ✓ Correct answer
- Θ(8n^2)
- Θ(8n^2 + 2n)
-
Number of _______ of the pseudo code are counted to measure the running time.
Topic: Complexity Analysis & Recurrences
- Inputs
- Outputs
- Steps ✓ Correct answer
- Pages
-
Asymptotic notations are used to describe _______ of an algorithm.
Topic: Complexity Analysis & Recurrences
- Length
- running time ✓ Correct answer
- size
- compile time
-
While analyzing algorithms, _______ and _______ usually considered difficult to calculate.
Topic: Complexity Analysis & Recurrences
- Finite, Infinite
- Floor, ceiling ✓ Correct answer
- Row, Column
- Graph, Tree
-
If an algorithm has a complexity of log2 n + n log2 n + n, we could say that it has complexity:
Topic: Complexity Analysis & Recurrences
- O(n)
- O(n log2 n) ✓ Correct answer
- O(3)
- O(log2 (log2 n))
-
The function f(n)= n(logn+1)/2 is asymptotically equivalent to n log n. Here Upper Bound means the function f(n) grows asymptotically ____________ faster than n log n. More
Topic: Complexity Analysis & Recurrences
- Quiet
- - Please choose one
- Not ✓ Correct answer
- At least
-
In analysis of f (n) =n (n/5) +n-10 log n, f (n) is asymptotically equivalent to ________.
Topic: Complexity Analysis & Recurrences
- n
- 2n
- n+1
- n2 ✓ Correct answer
-
The O-notation is used to state only the asymptotic ________bounds.
Topic: Complexity Analysis & Recurrences
- Two
- Lower
- Upper ✓ Correct answer
- Both lower & upper
-
Recurrence can be described in terms of_____________.
Topic: Complexity Analysis & Recurrences
- Array
- Linear
- Tree ✓ Correct answer
- Graph
-
A function is given as 4n^4 + 5n^3 + n. What is the running time (theta notation) of this function?
Topic: Complexity Analysis & Recurrences
- Θ(n^4) ✓ Correct answer
- Θ(n^3)
- Θ(4n^4 + 5n^3)
- Θ(n)
-
If algorithm A has running time 7n^2 + 2n + 3 and algorithm B has running time 2n^2, then
Topic: Complexity Analysis & Recurrences
- Both have same asymptotic time complexity ✓ Correct answer
- A is asymptotically greater
- B is asymptotically greater
- None of others
-
_________ is one of the few problems, where provable lower bounds exist on how fast we can sort.
Topic: Sorting & Divide and Conquer
- Searching
- Sorting ✓ Correct answer
- Both Searching & Sorting
- Graphing
-
How much time merge sort takes for an array of numbers?
Topic: Sorting & Divide and Conquer
- T(n^2)
- T(n)
- T( log n)
- T(n log n) ✓ Correct answer
-
While Sorting, the ordered domain means for any two input elements x and y _________ satisfies only.
Topic: Sorting & Divide and Conquer
- x<y
- x>y
- x=y
- All of the above ✓ Correct answer
-
If the indices passed to merge sort algorithm are ________,then this means that there is only one element to sort.
Topic: Sorting & Divide and Conquer
- Small
- Large
- Equal ✓ Correct answer
- Not Equal
-
Counting sort is suitable to sort the elements in the range 1 to k when:
Topic: Sorting & Divide and Conquer
- K is Large
- K is not known
- K may be small or large
- K is small ✓ Correct answer
-
Quick sort is
Topic: Sorting & Divide and Conquer
- Stable & in place
- Not stable but in place ✓ Correct answer
- Stable but not in place
- Some time stable & some times in place
-
Which may be a stable sort?
Topic: Sorting & Divide and Conquer
- Merger
- Insertion
- Both above ✓ Correct answer
- None of the above
-
_________ involves breaking up the problem into sub problems whose solutions can be combined to solve the global problem.
Topic: Sorting & Divide and Conquer
- Complexity Theory
- Dynamic programming solution
- Divide and Conquer Strategy ✓ Correct answer
- Greedy Algorithms
-
In Bucket sort, if there are duplicates then each bin can be replaced by a __________.
Topic: Sorting & Divide and Conquer
- Hash table
- Heap
- Stack
- Linked list ✓ Correct answer
-
In Quick Sort Constants hidden in T(n log n) are
Topic: Sorting & Divide and Conquer
- Large
- Medium
- Small ✓ Correct answer
- Not Known
-
In merge sort algorithm, we split the array ______ to find index q.
Topic: Sorting & Divide and Conquer
- from start
- midway ✓ Correct answer
- from end
- both from start or end
-
The worst case running time of Quick sort algorithm _____.
Topic: Sorting & Divide and Conquer
- Cannot be quadratic
- Is quadratic ✓ Correct answer
- ls always Exponential
- Is linear
-
In average-case time analysis of Quick sort algorithm, the most balanced case for partition is when we divide the list of elements into _.
Topic: Sorting & Divide and Conquer
- Equal no. of pieces as of input elements
- Single piece exactly
- Two nearly equal pieces ✓ Correct answer
- Three nearly equal pieces
-
In merge sort algorithm, to merge two lists of size n/2 to a list of size n, takes _______ time.
Topic: Sorting & Divide and Conquer
- Theta (n) ✓ Correct answer
- Theta log(n)
- Theta log2(n)
- Theta n log(n)
-
For average-case time analysis of Quick sort algorithm, Pivot selection is on average basis from ______
Topic: Sorting & Divide and Conquer
- half of the input values
- all possible random values ✓ Correct answer
- Pivot is input separately
- values greater than 5
-
Heap sort is a/ an ______ and ________ sorting algorithem.
Topic: Sorting & Divide and Conquer
- Not in place, not stable one
- In place , not stable one ✓ Correct answer
- In place , stable one
- Not in place , stable one
-
Sorting is performed on the basis of ___________.
Topic: Sorting & Divide and Conquer
- Computational resources
- Asymptotic notation
- Summation
- Some key value of attribute ✓ Correct answer
-
The process of ______ ends when you are left with such tiny pieces remaining that it is trivial to solve them.
Topic: Sorting & Divide and Conquer
- Brute-force
- Plan-sweep
- Divide and Conquer ✓ Correct answer
- Axis-sweep
-
Which one is not passed as parameter in Quick sort algorithm?
Topic: Sorting & Divide and Conquer
- End of the array
- Middle of the array ✓ Correct answer
- Array (containing input elements)
- Start of the array
-
In Quick sort algorithm, Pivots form ___
Topic: Sorting & Divide and Conquer
- Stack
- Queue
- Binary Search Tree ✓ Correct answer
- Graph
-
Counting sort has time complexity.
Topic: Sorting & Divide and Conquer
- O(n+k) ✓ Correct answer
- O(n)
- O(k)
- O(nlogn)
-
Quick sort algorithm divide the entire array into ________ sub arrays.
Topic: Sorting & Divide and Conquer
- 2 ✓ Correct answer
- 3
- 4
- 5
-
Which symbol is used for Omega notation?
Topic: Sorting & Divide and Conquer
- (O)
- (ϴ)
- (Ω) ✓ Correct answer
- (@)
-
Selection sort is a ______ sorting algorithm
Topic: Sorting & Divide and Conquer
- In-place ✓ Correct answer
- Not In-Place
- Stable
- in-partition
-
We do not need to prove comparison-based sorting algorithms by mathematically. It always takes _________ time.
Topic: Sorting & Divide and Conquer
- Big Oh n log(n)
- Omega n log(n) ✓ Correct answer
- Omega n^2
- Theta n log(n)
-
Merge sort is a/an _______ and ________ sorting algorithm
Topic: Sorting & Divide and Conquer
- Not in-place, not stable one
- In-place, not stable one
- In-place, stable one
- Not in-place, stable one ✓ Correct answer
-
Insertion sort is a _________ sorting algorithm
Topic: Sorting & Divide and Conquer
- Unstable
- In-place ✓ Correct answer
- Not In-Place
- in-partition
-
Bubble sort takes theta _________ in the worst case
Topic: Sorting & Divide and Conquer
- (n2) ✓ Correct answer
- (n)
- log(n)
- nlog(n)
-
________________ is in-place sorting algorithm.
Topic: Sorting & Divide and Conquer
- Bubble sort ✓ Correct answer
- Merge sort
- Linear search
- Binary Search
-
What is the average running time of a quick sort algorithm?
Topic: Sorting & Divide and Conquer
- O(n^2)
- O(n)
- O(n log n) ✓ Correct answer
- O(log n)
-
Sorting Algorithms having O _______ running time are considered to be slow ones.
Topic: Sorting & Divide and Conquer
- (n)
- (n^2) ✓ Correct answer
- (nlog(n))
- (log(n))
-
The running time of quick sort algorithm_________.
Topic: Sorting & Divide and Conquer
- Is impossible to compute
- Has nothing to do with pivot selection
- Is Random upon each execution
- Greatly influenced by the selection of pivot ✓ Correct answer
-
Sorting can be in ______________.
Topic: Sorting & Divide and Conquer
- Increasing order only
- Decreasing order only
- Both increasing and decreasing order ✓ Correct answer
- Random order
-
_________ is always based on divide and conquer strategy.
Topic: Sorting & Divide and Conquer
- Bubble sort
- Selection sort
- Pigeon sort
- Quick sort ✓ Correct answer
-
________ is a linear time sorting algorithm.
Topic: Sorting & Divide and Conquer
- Merge sort
- Radix sort ✓ Correct answer
- Quick sort
- Bubble sort
-
Quick sort is one of the _____ sorting algorithm.
Topic: Sorting & Divide and Conquer
- Fastest ✓ Correct answer
- Slowest
- Major
- Average
-
Insertion sort is an efficient algorithm for sorting a __________ number of elements
Topic: Sorting & Divide and Conquer
- Large
- Small ✓ Correct answer
- Extra large
- Medium
-
In quick sort algorithm, we choose pivot___________.
Topic: Sorting & Divide and Conquer
- Always the smallest element
- Greater than 5
- Randomly ✓ Correct answer
- Less than 5
-
For quick sort algorithm. Partitioning takes theta ________.
Topic: Sorting & Divide and Conquer
- (n) ✓ Correct answer
- log(n)
- n log (n)
- n2log (n)
-
Is it possible to sort without making comparisons?
Topic: Sorting & Divide and Conquer
- Yes ✓ Correct answer
- No
-
If the indices passed to merge sort algorithm are not equal, the algorithm may return immediately.
Topic: Sorting & Divide and Conquer
- True
- False ✓ Correct answer
-
One example of in place but not stable algorithm is
Topic: Sorting & Divide and Conquer
- Merger Sort
- Quick Sort ✓ Correct answer
- Continuation Sort
- Bubble Sort
-
Assume that A[1..i-1] have already been sorted. Insert A[i] into its proper position in this subarray, creating this position by shifting all larger elements to the right. This process is called:
Topic: Sorting & Divide and Conquer
- Bubble sort
- Selection sort
- Insertion sort ✓ Correct answer
- Merge sort
-
A sorting algorithm is called as ________ if duplicate elements remain in the same relative position after sorting.
Topic: Sorting & Divide and Conquer
- O(n) algorithm
- Complex
- Parallel
- Stable ✓ Correct answer
-
Quick sort algorithm required a lot of comparisons in the ____________ condition.
Topic: Sorting & Divide and Conquer
- Worst case ✓ Correct answer
- Best and Average case
- Average case
- Best case
-
In ____________, the size of recursive calls is totally depending on how pivot is chosen.
Topic: Sorting & Divide and Conquer
- Quick sort ✓ Correct answer
- Merge sort
- Insert sort
- Bubble sort
-
The main shortcoming of counting sort is that it is useful for__________.
Topic: Sorting & Divide and Conquer
- large integers
- large real numbers
- small real numbers
- small integers ✓ Correct answer
-
Selection sort takes theta __________ in the worst case.
Topic: Sorting & Divide and Conquer
- (n)
- (n^2) ✓ Correct answer
- nlog(n)
- n(logn)
-
An in-place sorting algorithm is one that ___________ use(s) additional array for storage.
Topic: Sorting & Divide and Conquer
- Always
- Permanently
- Does not ✓ Correct answer
- Sometime
-
In quick sort algorithm, _________ decides nature of Binary Search Tree formed by pivots.
Topic: Sorting & Divide and Conquer
- Rank of the pivot ✓ Correct answer
- Middle element from input
- Smallest element from input
- Largest element from input
-
What is the best case time complexity of merge sort?
Topic: Sorting & Divide and Conquer
- O((n^2)
- O((nlogn) ✓ Correct answer
- O((nlogn^2)
- O((n^2logn)
-
Radix sort is a ___________________ integer sorting algorithm.
Topic: Sorting & Divide and Conquer
- In-Place
- Unstable
- Comparative
- Non-comparative ok ✓ Correct answer
-
The main elements to a divide-and-conquer solution are___
Topic: Sorting & Divide and Conquer
- Divide: the problem into a small number of pieces
- Conquer: solve each piece by applying divide and conquer to it recursively
- Combine: the pieces together into a global solution
- All of the above. ✓ Correct answer
-
The merge sort algorithm works by ________
Topic: Sorting & Divide and Conquer
- (Divide:) split A down the middle into two subsequences, each of size roughly n/2
- (Conquer:) sort each subsequence by calling merge sort recursively on each.
- (Combine:) merge the two sorted subsequences into a single sorted list.
- All of the above. ✓ Correct answer
-
Scan the array. Whenever two consecutive items are found that are out of order, swap them. Repeat until all consecutive items are in order. It is called ______________
Topic: Sorting & Divide and Conquer
- Insertion sort
- Bubble sort ✓ Correct answer
- Selection sort
- none
-
Assume that A[1..i − 1] contain the i − 1 smallest elements in sorted order. Find the smallest element in A[i..n] Swap it with A[i].It is called _____________
Topic: Sorting & Divide and Conquer
- Selection sort ✓ Correct answer
- Insertion sort
- Merge sort
- Bubble sort
-
In the worst case time _________ run in Θ(n2)___
Topic: Sorting & Divide and Conquer
- Bubble sort
- Selection sort
- Insertion sort
- All of the above ✓ Correct answer
-
Due to left complete nature of binary tree, the heap can be stored in
Topic: Heap & Heap Sort
- Arrays ✓ Correct answer
- Structures
- Link Lis
- Stack
-
In Heap Sort algorithm, if heap property is violated _________
Topic: Heap & Heap Sort
- We call Build heap procedure
- We call Heapify procedure ✓ Correct answer
- We ignore
- Heap property can never be violated
-
In Heap Sort algorithm, the maximum levels an element can move upward is _________
Topic: Heap & Heap Sort
- Theta (log n) ✓ Correct answer
- Order (log n)
- Omega (log n)
- O (1) i.e. Constant time
-
When we call heapify then at each level the comparison performed takes time
Topic: Heap & Heap Sort
- It will take Θ (1) ✓ Correct answer
- Time will vary according to the nature of input data
- It can not be predicted
- It will take Θ (log n)
-
For the heap sort we store the tree nodes in
Topic: Heap & Heap Sort
- level-order traversal ✓ Correct answer
- in-order traversal
- pre-order traversal
- post-order traversal
-
In Heap Sort algorithm (using max heap), when every time maximum elements removed from top ________.
Topic: Heap & Heap Sort
- We call merge Sort Algorithm
- it becomes Order n2 Algorithm
- Divide and Conquer strategy helps us
- We are left with a hole ✓ Correct answer
-
In max heap (for Heap Sort algorithm), when every time maximum element is removed from top we replace it with _____ leaf in the tree.
Topic: Heap & Heap Sort
- second last
- Last ✓ Correct answer
- First
- Any
-
In max-heap, largest element is stored at root node. Where is the smallest element stored?
Topic: Heap & Heap Sort
- Right Node
- Leaf Node ✓ Correct answer
- Middle Node
- Left Node
-
In Heapsort Algorithm, total time taken by heapify procedure is ________
Topic: Heap & Heap Sort
- O (log n) ✓ Correct answer
- O (log2 n)
- O (n log n)
- O (n2 log n)
-
In Heap Sort algorithm, we call Build-heap procedure ____________.
Topic: Heap & Heap Sort
- Only once ✓ Correct answer
- Twice
- Thrice
- As many times as we need
-
In Heap Sort algorithm. Heapify procedure is ________ in nature.
Topic: Heap & Heap Sort
- Recursive ✓ Correct answer
- Non-Recursive
- Fast
- Slow
-
The number of nodes in a complete binary tree of height h is
Topic: Heap & Heap Sort
- 2^(h+1) – 1 ✓ Correct answer
- 2 * (h+1) – 1
- 2 * (h+1)
- ((h+1) ^ 2) – 1
-
A (an) _________ is a left-complete binary tree that conforms to the heap order
Topic: Heap & Heap Sort
- heap ✓ Correct answer
- binary tree
- binary search tree
- array
-
For the heap sort, access to nodes involves simple _______________ operations.
Topic: Heap & Heap Sort
- arithmetic ✓ Correct answer
- binary
- algebraic
- logarithmic
-
In Heap Sort algorithm, the first step is to _ _.
Topic: Heap & Heap Sort
- Call Build-Heap procedure ✓ Correct answer
- Sort the array in descending order
- Call Heapify procedure
- Find the number of input elements
-
A Principal operation for maintaining the heap property is called heapify, it is also called:
Topic: Heap & Heap Sort
- Sifting Up
- Sifting left
- Sifting right
- Sifting down ✓ Correct answer
-
In Heap Sort algorithm, we build _______ for ascending sort.
Topic: Heap & Heap Sort
- Min heap
- Max Heap ✓ Correct answer
- Both
- None of these
-
Thus the smallest key is in the root in a_________ ; in the _________the largest is in the root.___
Topic: Heap & Heap Sort
- max heap, min heap
- min heap , max heap ✓ Correct answer
- max heap , max heap
- min heap , min heap
-
In plane sweep approach, a vertical line is swept across the 2d-plane and _______structure is used for holding the maximal points lying to the left of the sweep line.
Topic: Sieve Technique & Selection
- Array
- Queue
- Stack ✓ Correct answer
- Tree
-
Brute-force algorithm for 2D-Maxima is operated by comparing ________ pairs of points.
Topic: Sieve Technique & Selection
- Two
- Some
- Most
- All ✓ Correct answer
-
Before sweeping a vertical line in plane sweep approach, in start sorting of the points is done in increasing order of their _______coordinates.
Topic: Sieve Technique & Selection
- X ✓ Correct answer
- Y
- Z
- X&Y
-
If we associate (x, y) integers pair to cars where x is the speed of the car and y is the negation of the price. High y value for a car means a ________ car.
Topic: Sieve Technique & Selection
- Fast
- Slow
- Expensive
- Cheap ✓ Correct answer
-
In ____________ we have to find rank of an element from given input.
Topic: Sieve Technique & Selection
- Merge sort algorithm
- Selection problem ✓ Correct answer
- Brute force technique
- Plane Sweep algorithm
-
Sieve Technique applies to problems where we are interested in finding a single item from a larger set of _____________ Select correct option:
Topic: Sieve Technique & Selection
- n items ✓ Correct answer
- phases
- pointers
- constant
-
While solving Selection problem, in Sieve technique we partition input data __________
Topic: Sieve Technique & Selection
- In increasing order
- In decreasing order
- According to Pivot ✓ Correct answer
- Randomly
-
In 2d-space a point is said to be ________if it is not dominated by any other point in that space.
Topic: Sieve Technique & Selection
- Member
- Minimal
- Maximal ✓ Correct answer
- Joint
-
In Selection algorithm, we assume pivot selection takes theta _______ running time.
Topic: Sieve Technique & Selection
- Θ(n) ✓ Correct answer
- Θ(n^2)
- Θ(n^3)
- Θ(log n)
-
Selection algorithm takes theta ______
Topic: Sieve Technique & Selection
- Θ(n^2)
- Θ(n) ✓ Correct answer
- Θ(log n)
- Θ(n log n)
-
Rank of an element can be defined as ___________.
Topic: Sieve Technique & Selection
- One minus the number of elements that are smaller
- Two plus the number of elements that are greater
- One plus the number of elements that are smaller ✓ Correct answer
- Two minus the number of elements that are smaller
-
Approach of solving geometric problems by sweeping a line across the plane is called _____ sweep.
Topic: Sieve Technique & Selection
- Line
- Plane ✓ Correct answer
- Cube
- Box
-
In Sieve technique, we solve the problem
Topic: Sieve Technique & Selection
- In recursive manner ✓ Correct answer
- Non recursively
- Using Merge Sort algorithm
- Using Brute force technique
-
In Selection problem, the Sieve technique works in __________.
Topic: Sieve Technique & Selection
- Non-recursive manner
- Constant time
- Phases ✓ Correct answer
- One complete go
-
If pj dominates pi and pi dominates ph then pj also dominates ph, it means dominance relation is
Topic: Sieve Technique & Selection
- Transitive ✓ Correct answer
- Non Transitive
- Equation
- Symbolic
-
In Selection problem, the Sieve technique _________.
Topic: Sieve Technique & Selection
- Add some more input items each time
- Do not work recursively
- Do not uses Divide and Conquer approach
- Eliminates undesired data items each time ✓ Correct answer
-
For solving Selection problem, we introduced Sieve technique due to _______
Topic: Sieve Technique & Selection
- Using Decrease and Conquer strategy
- Avoiding to sort all input data ✓ Correct answer
- Eliminating Rank of an element
- Using Brute-force approach
-
In plane sweep approach, a vertical line is swept across the 2d-plane from_____.
Topic: Sieve Technique & Selection
- Right to Left
- Left to Right ✓ Correct answer
- Top to Bottom
- Bottom to top
-
For 2D Maxima problem. Plane Sweep algorithm first of all _________.
Topic: Sieve Technique & Selection
- Sorts all points ✓ Correct answer
- Delete some points
- Output the elements
- Pushes all points on stack
-
In 2-d maxima problem a point p is said to be dominated by point q if _________.
Topic: Sieve Technique & Selection
- p.x <= q.x
- p.x <= q.x and p.y <= q.y ✓ Correct answer
- p.y <= q.y
- p.x >= q.x and p.y >=q.y
-
The brute-force algorithm for 2D-Maxima runs in order O(__) time.
Topic: Sieve Technique & Selection
- n
- n(log n)
- n*n ✓ Correct answer
- n3
-
In selection algorithm, because we eliminate a constant fraction of the array with each phase, we get the
Topic: Sieve Technique & Selection
- Convergent geometric series ✓ Correct answer
- Divergent geometric series
- None of these
-
A point p in 2-dimensional space is usually given by its integer coordinate(s)____________
Topic: Sieve Technique & Selection
- p.x only
- p.y only
- p.x & p.z
- p.x & p.y ✓ Correct answer
-
While applying the sieve technique, ___________ subarray will contain all elements that are greater than pivot element x.
Topic: Sieve Technique & Selection
- A[q+1....n] ✓ Correct answer
- A[1....n]
- A[1....q-1]
- A[q]
-
on right Sieve technique is a special case of ___________ strategy.
Topic: Sieve Technique & Selection
- Greedy approach
- Graph
- Divide-and-Conquer ✓ Correct answer
- Dynamic programming
-
Array divided into _____ subarrays while applying sieve technique to selection problem.
Topic: Sieve Technique & Selection
- 1
- 2 ✓ Correct answer
- 3
- 4
-
If input “n” is odd, then median will be _________
Topic: Sieve Technique & Selection
- n/2
- n+2
- (n-1)/2
- (n+1)/2 ✓ Correct answer
-
While analyzing Selection algorithm, we make a number of passes, in fact it could be as many as ________.
Topic: Sieve Technique & Selection
- n(n+1)
- log(n) ✓ Correct answer
- n/3
- n/4
-
For the Sieve Technique we take time:
Topic: Sieve Technique & Selection
- T(nk) ✓ Correct answer
- T(n / 3)
- n^2
- n / 3
-
While applying the Sieve technique to the selection problem, how do we choose a pivot element?
Topic: Sieve Technique & Selection
- Through mean
- Linear
- Randomly ✓ Correct answer
- Sequentially
-
Consider the set: {5, 7, 2, 10, 8, 15, 21, 37, 41}. The rank of each number is its position in the sorted order. For example, rank of 8 is ______ , one plus the number of elements ________ 8 which is 3___
Topic: Sieve Technique & Selection
- 3 , equal to
- 4 , greater then
- 3 , smaller then
- 4 , smaller then ✓ Correct answer
-
In Knapsack problem, the goal is to put items in the Knapsack such that the value of the items is __________ subject to weight limit of knapsack.
Topic: Dynamic Programming & Matrix Chain
- Minimized
- Decreased
- Maximized ✓ Correct answer
- None of the given options
-
In inductive approach of knapsack problem, we consider 2 cases, _______ Or ________.
Topic: Dynamic Programming & Matrix Chain
- Median, Mode
- Recursive, Iterative
- Leave object, Take object ✓ Correct answer
- Sequentially. Parallel
-
If Matrix-A has dimensions "3x2" and Matrix-B has dimensions "2x3", then multiplication of Matrix-A and Matrix-B will result a new Matrix-C having dimensions.
Topic: Dynamic Programming & Matrix Chain
- 3x2
- 2x3
- 2x2
- 3x3 ✓ Correct answer
-
In Dynamic Programming based solution of Knapsack Problem, if we decide to take an object i , then we gain______
Topic: Dynamic Programming & Matrix Chain
- W (Total Weight of Knapsack)
- V (Total Value of all items)
- vi (Value of object i) ✓ Correct answer
- None of the given options
-
In Dynamic Programming based solution of knapsack problem, to compute entries of 'V', we will imply a(n) ________ approach.
Topic: Dynamic Programming & Matrix Chain
- Subjective
- Inductive ✓ Correct answer
- Brute Force
- Combination
-
In recursive formulation of knapsack Problem: V [0, j] = ________ for j>=0
Topic: Dynamic Programming & Matrix Chain
- -1
- 0 ✓ Correct answer
- 1
- 2
-
In ______ Knapsack Problem, limitation is that an item can either be put in the bag or not. Fractional items are not allowed.
Topic: Dynamic Programming & Matrix Chain
- 0
- 1
- 0/1 ✓ Correct answer
- Fractional
-
If matrix A of dimension p x q is multiply with matrix B of dimension q x r, then each entry in resultant matrix takes _______ time.
Topic: Dynamic Programming & Matrix Chain
- O (q) ✓ Correct answer
- O (1)
- O (p x q)
- O (q x r)
-
Edit distance algorithm based on ________ strategy
Topic: Dynamic Programming & Matrix Chain
- Greedy
- Dynamic Programming ✓ Correct answer
- Divide and Conquer
- Searching
-
When matrix A of 5x3 is multiplied with matrix B of 3x4, then the number of multiplications required is:
Topic: Dynamic Programming & Matrix Chain
- 15
- 12
- 36
- 60 ✓ Correct answer
-
Following is NOT the application of Edit Distance problem.
Topic: Dynamic Programming & Matrix Chain
- Speech recognition
- Spelling Correction
- Ascending Sort ✓ Correct answer
- Computational Molecular Biology
-
Chain matrix multiplication problem can be solved through ______ strategy.
Topic: Dynamic Programming & Matrix Chain
- Dynamic programming ✓ Correct answer
- Greedy
- Divide and conquer
- Sorting
-
Consider three matrices X,Y,Z of dimensions 1x2, 2x3,3x4 respectively. The number of multiplications of (XY) Z is:
Topic: Dynamic Programming & Matrix Chain
- 18 ✓ Correct answer
- 32
- 24
- 30
-
Identify the True Statement
Topic: Dynamic Programming & Matrix Chain
- The knapsack problem does not belong to the domain of optimization problems.
- The knapsack problem belongs to the domain of optimization problems. ✓ Correct answer
- The Knapsack problem cannot be solved by using dynamic programming
- The knapsack problem is optimally solved by using brute force algorithm.
-
In Dynamic Programming, our approach is to _________
Topic: Dynamic Programming & Matrix Chain
- Develop the solution in a top-down fashion
- Express the problem non-recursively
- Build the solution in a bottom-up fashion ✓ Correct answer
- Input several sub-problems simultaneously
-
Matrix multiplication is a (n) ________ operation.
Topic: Dynamic Programming & Matrix Chain
- Commutative
- Associative ✓ Correct answer
- Neither commutative nor associative
- Commutative but not associative
-
The only way to convert a string of i characters into the empty string is with i deletions, represented as
Topic: Dynamic Programming & Matrix Chain
- E(0, j) = j
- E(i, j) = 1
- E(0, i) = j
- E(i, 0) = i ✓ Correct answer
-
Dynamic programming formulation of the matrix chain multiplication problem will store the solutions of each sub problem in an
Topic: Dynamic Programming & Matrix Chain
- Array
- Table ✓ Correct answer
- Variable
- class
-
We can use the optimal substructure property to devise a formulation of the edit distance problem.
Topic: Dynamic Programming & Matrix Chain
- Selective
- Optimum
- Iterative
- Recursive ✓ Correct answer
-
As per algorithm of Dynamic Programing, we need to store
Topic: Dynamic Programming & Matrix Chain
- First sub-problem only
- Best solution only
- Intermediate sub-problems ✓ Correct answer
- Final solution only
-
Which one of the following problems can be solved using dynamic problem?
Topic: Dynamic Programming & Matrix Chain
- Bubble sort problem
- Matrix chain multiplication problem ✓ Correct answer
- Greedy search problem
- Fractional knapsack problem
-
________ is the process of avoiding unnecessary repetitions by writing down the results of recursive calls and looking them up again if we need them later.
Topic: Dynamic Programming & Matrix Chain
- Loop
- Memoization ✓ Correct answer
- Recursion
- Function
-
Dynamic Programming approach is usually useful in solving _______ problems.
Topic: Dynamic Programming & Matrix Chain
- Normal
- Optimization ✓ Correct answer
- Array
- Loop
-
In chain matrix multiplication, the order of the matrices __________.
Topic: Dynamic Programming & Matrix Chain
- Can be changed
- Can not be changed ✓ Correct answer
- is equal
- is reverse
-
_______ programming is essentially recursion without repetition.
Topic: Dynamic Programming & Matrix Chain
- Fast
- Dynamic ✓ Correct answer
- Array
- n (log n)
-
A/an is one in which you want to find, not just a solution, but thebest solution.
Topic: Dynamic Programming & Matrix Chain
- Optimization Problem ✓ Correct answer
- Divide and Conquer
- NP Complete problem
- Best Problem
-
Suppose we have three items as shown in the following table, and suppose the capacity of the knapsack is 50 i.e. W = 50. (Item 1: value 60, weight 10; Item 2: value 100, weight 20; Item 3: value 120, weight 30). The optimal solution is to pick:
Topic: Dynamic Programming & Matrix Chain
- Items 1 and 2
- Items 1 and 3
- Items 2 and 3 ✓ Correct answer
- None of these
-
In chain matrix multiplication, if there are n items, there are _ ways in which outer most pair of parentheses can placed.
Topic: Dynamic Programming & Matrix Chain
- n^2
- 2n
- n+1
- n-1 ✓ Correct answer
-
The running time of brute-force algorithm to solve Knapsack problem is .
Topic: Dynamic Programming & Matrix Chain
- O(n)
- O(n3)
- O(n!)
- O(2^n) ✓ Correct answer
-
Using base condition we set all m[i,i] = ___________ ?
Topic: Dynamic Programming & Matrix Chain
- 1
- 0 ✓ Correct answer
- ∞
- -1
-
Algorithms similar to those for the ______________ problem are used in some speech recognition systems.
Topic: Dynamic Programming & Matrix Chain
- Counting
- heap sort
- Fibonacci
- edit-distance ✓ Correct answer