Computer Science EngineeringHardISRO SC (CS)
The length of a longest common subsequence of DAAAADDCBB and CBCCDCBBA is:
- A. 5
- B. 3
- C. 4
- D. 9
Correct answer: C. 4
Fill the LCS table d[i][j]; the answer is 4 (the longest common substring would be only 4).
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- Using the Master theorem (extended form), the solution of T(n) = 4T(n/2) + n log^2 n is:
- The keys [40, 18, 25, 51, 17, 19] are inserted in this order into an initially empty AVL tree. The height of the final tree, counted in…
- 0/1 knapsack: item weights [4, 3, 3, 8, 7], values [18, 11, 18, 8, 4], capacity 15. The maximum total value is:
- The number of distinct spanning trees of the complete bipartite graph K2,4 is:
- The number of distinct permutations of 1..6 that can be produced as output by pushing 1,2,...,6 in order onto a stack and popping at any…
- The number of distinct combinations (order ignored) of coins from [2, 5, 3, 6] (unlimited supply of each) that sum to 10 is: