Explore topic-wise MCQs in Computer Science Engineering (CSE).

This section includes 397 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.

251.

Consider the 2×2 matrix {{-1,-2},{-3,-4}}. What is the sum of elements of the maximum sum rectangle?

A. 0
B. -1
C. -7 d) -12
Answer» C. -7 d) -12
252.

Consider the 2×3 matrix {{1,2,3},{1,2,3}}. What is the sum of elements of the maximum sum rectangle?

A. 3
B. 6
C. 12
D. 18
Answer» D. 18
253.

Which of the following problems can be used to solve the minimum number of insertions to form a palindrome problem?

A. minimum number of jumps problem
B. longest common subsequence problem
C. coin change problem
D. knapsack problems
Answer» C. coin change problem
254.

Consider the string “abbccbba”. What is the minimum number of insertions required to make the string a palindrome?

A. 0
B. 1
C. 2
D. 3
Answer» B. 1
255.

In which of the following cases the minimum no of insertions to form palindrome is maximum?

A. string of length one
B. string with all same characters
C. palindromic string
D. non palindromic string
Answer» E.
256.

Given a string, you have to find the minimum number of characters to be inserted in the string so that the string becomes a palindrome. Which of the following methods can be used to solve the problem?

A. greedy algorithm
B. recursion
C. dynamic programming
D. both recursion and dynamic programming
Answer» E.
257.

In the worst case, the minimum number of insertions to be made to convert the string into a palindrome is equal to the length of the string.

A. true
B. false
C. answer: b
D. explanation: in the worst case, the minimum number of insertions to be made to convert the string into a palindrome is equal to length of the string minus one. for example, consider the string “abc”. the string can be converted to “abcba” by inserting “a” and “b”. the number of insertions is two, which is equal to length minus one.
Answer» C. answer: b
258.

What is the time complexity of the above dynamic programming implementation of the assembly line scheduling problem?

A. o(1)
B. o(n)
C. o(n2)
D. o(n3)
Answer» C. o(n2)
259.

In the dynamic programming implementation of the assembly line scheduling problem, how many lookup tables are required?

A. 0
B. 1
C. 2
D. 3
Answer» D. 3
260.

What is the time complexity of the brute force algorithm used to solve the assembly line scheduling problem?

A. o(1)
B. o(n)
C. o(n2)
D. o(2n)
Answer» E.
261.

Which of the following methods can be used to solve the assembly line scheduling problem?

A. recursion
B. brute force
C. dynamic programming
D. all of the mentioned
Answer» E.
262.

Which of the following implementations of Catalan numbers has the smallest time complexity?

A. dynamic programming
B. binomial coefficients
C. recursion
D. all have equal time complexity
Answer» C. recursion
263.

What is the time complexity of the Wagner–Fischer algorithm where “m” and “n” are the lengths of the two strings?

A. o(1)
B. o(n+m)
C. o(mn)
D. o(nlogm)
Answer» D. o(nlogm)
264.

Consider the two strings “”(empty string) and “abcd”. What is the edit distance between the two strings?

A. 0
B. 4
C. 2
D. 3
Answer» C. 2
265.

Suppose each edit (insert, delete, replace) has a cost of one. Then, the maximum edit distance cost between the two strings is equal to the length of the larger string.

A. true
B. false
Answer» B. false
266.

For every non-empty string, the length of the longest palindromic subsequence is at least one.

A. true
B. false
Answer» B. false
267.

What is the time complexity of the brute force algorithm used to find the length of the longest palindromic subsequence?

A. o(1)
B. o(2n)
C. o(n)
D. o(n2)
Answer» C. o(n)
268.

What is the length of the longest palindromic subsequence for the string “ababcdabba”?

A. 6
B. 7
C. 8
D. 9
Answer» C. 8
269.

For which of the following, the length of the string is not equal to the length of the longest palindromic subsequence?

A. a string that is a palindrome
B. a string of length one
C. a string that has all the same letters(e.g. aaaaaa)
D. some strings of length two
Answer» E.
270.

Which of the following is the longest common subsequence between the strings “hbcfgmnapq” and “cbhgrsfnmq” ?

A. hgmq
B. cfnq
C. bfmq
D. fgmna
Answer» E.
271.

Consider the strings “PQRSTPQRS” and “PRATPBRQRPS”. What is the length of the longest common subsequence?

A. 9
B. 8
C. 7
D. 6
Answer» D. 6
272.

The 0-1 Knapsack problem can be solved using Greedy algorithm.

A. true
B. false
Answer» C.
273.

For every rod cutting problem there will be a unique set of pieces that give the maximum price.

A. true
B. false
Answer» C.
274.

For any given sequence, there will ALWAYS be a unique increasing subsequence with the longest length.

A. true
B. false
Answer» C.
275.

What is the space complexity of Kadane’s algorithm?

A. o(1)
B. o(n)
C. o(n2)
D. none of the mentioned
Answer» B. o(n)
276.

For which of the following inputs would Kadane’s algorithm produce a WRONG output?

A. {1,0,-1}
B. {-1,-2,-3}
C. {1,2,3}
D. {0,0,0}
Answer» C. {1,2,3}
277.

Kadane’s algorithm is used to find

A. longest increasing subsequence
B. longest palindrome subsequence
C. maximum sub-array sum
D. longest decreasing subsequence
Answer» D. longest decreasing subsequence
278.

What is the space complexity of the divide and conquer algorithm used to find the maximum sub-array sum?

A. o(n)
B. o(1)
C. o(n!)
D. o(n2)
Answer» C. o(n!)
279.

Kadane’s algorithm uses which of the following techniques?

A. divide and conquer
B. dynamic programming
C. recursion
D. greedy algorithm
Answer» C. recursion
280.

You are given infinite coins of denominations 1, 3, 4. What is the minimum number of coins required to achieve a sum of 7?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
281.

Suppose you have coins of denominations 1,3 and 4. You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm produce an optimal answer?

A. 14
B. 10
C. 6
D. 100
Answer» E.
282.

You are given infinite coins of N denominations v1, v2, v3,…..,vn and a sum S. The coin change problem is to find the minimum number of coins required to get the sum S. What is the time complexity of a dynamic programming implementation used to solve the coin change problem?

A. o(n)
B. o(s)
C. o(n2)
D. o(s*n)
Answer» E.
283.

You are given infinite coins of denominations v1, v2, v3,…..,vn and a sum S. The coin change problem is to find the minimum number of coins required to get the sum S. This problem can be solved using

A. greedy algorithm
B. dynamic programming
C. divide and conquer
D. backtracking
Answer» C. divide and conquer
284.

return fibo_terms[n]

A. o(1)
B. o(n)
C. o(n2)
D. exponential
Answer» C. o(n2)
285.

What is the space complexity of the recursive implementation used to find the nth fibonacci term?

A. o(1)
B. o(n)
C. o(n2)
D. o(n3)
Answer» B. o(n)
286.

What is the time complexity of the recursive implementation used to find the nth fibonacci term?

A. o(1)
B. o(n2)
C. o(n!)
D. exponential
Answer» E.
287.

Which of the following problems should be solved using dynamic programming?

A. mergesort
B. binary search
C. longest common subsequence
D. quicksort
Answer» D. quicksort
288.

Which of the following problems is NOT solved using dynamic programming?

A. 0/1 knapsack problem
B. matrix chain multiplication problem
C. edit distance problem
D. fractional knapsack problem
Answer» E.
289.

A greedy algorithm can be used to solve all the dynamic programming problems.

A. true
B. false
Answer» C.
290.

In dynamic programming, the technique of storing the previously calculated values is called

A. saving value property
B. storing value property
C. memoization
D. mapping
Answer» D. mapping
291.

When dynamic programming is applied to a problem, it takes far less time as compared to other methods that don’t take advantage of overlapping subproblems.

A. true
B. false
Answer» B. false
292.

When a top-down approach of dynamic programming is applied to a problem, it usually

A. decreases both, the time complexity and the space complexity
B. decreases the time complexity and increases the space complexity
C. increases the time complexity and decreases the space complexity
D. increases both, the time complexity and the space complexity
Answer» C. increases the time complexity and decreases the space complexity
293.

If a problem can be broken into subproblems which are reused several times, the problem possesses                           property.

A. overlapping subproblems
B. optimal substructure
C. memoization
D. greedy
Answer» B. optimal substructure
294.

The time taken to compute the transitive closure of a graph is Theta(n2).

A. true
B. false
Answer» C.
295.

Using logical operator’s instead arithmetic operators saves time and space.

A. true
B. false
Answer» B. false
296.

What happens when the value of k is 0 in the Floyd Warshall Algorithm?

A. 1 intermediate vertex
B. 0 intermediate vertex
C. n intermediate vertices
D. n-1 intermediate vertices
Answer» C. n intermediate vertices
297.

Who proposed the modern formulation of Floyd-Warshall Algorithm as three nested loops?

A. robert floyd
B. stephen warshall
C. bernard roy
D. peter ingerman
Answer» E.
298.

Floyd- Warshall algorithm was proposed by

A. robert floyd and stephen warshall
B. stephen floyd and robert warshall
C. bernad floyd and robert warshall
D. robert floyd and bernad warshall
Answer» B. stephen floyd and robert warshall
299.

What procedure is being followed in Floyd Warshall Algorithm?

A. top down
B. bottom up
C. big bang
D. sandwich
Answer» C. big bang
300.

Floyd Warshall Algorithm can be used for finding

A. single source shortest path
B. topological sort
C. minimum spanning tree
D. transitive closure
Answer» E.