For any given sequence, there will ALWAYS be a unique increasing subsequence with the longest length.
True
False
Browse topic-based Data Structure And Algorithm practice sets.
302 practice sets · Page 8 of 16
For any given sequence, there will ALWAYS be a unique increasing subsequence with the longest length.
True
False
Find the length of the longest increasing subsequence for the given sequence: {-10, 24, -9, 35, -21, 55, -41, 76, 84}
5
4
3
6
Find the longest increasing subsequence for the given sequence: {10, -10, 12, 9, 10, 15, 13, 14}
{10, 12, 15}
{10, 12, 13, 14}
{-10, 12, 13, 14}
{-10, 9, 10, 13, 14}
The longest increasing subsequence problem is a problem to find the length of a subsequence from a sequence of array elements such that the subsequence is sorted in increasing order and it's length is maximum. This problem can be solved using __________
Recursion
Dynamic programming
Brute force
Recursion, Dynamic programming, Brute force
Which of the following is the longest common subsequence between the strings "hbcfgmnapq" and "cbhgrsfnmq" ?
hgmq
cfnq
bfmq
fgmna
Which of the following lines completes the above code?
arr[i][j] = 1 + arr[i][j].
arr[i][j] = 1 + arr[i - 1][j - 1].
arr[i][j] = arr[i - 1][j - 1].
arr[i][j] = arr[i][j].
What is the time complexity of the brute force algorithm used to find the longest common subsequence?
O(n)
O(n^{2})
O(n^{3})
O(2^{n})
Longest common subsequence is an example of ____________
Greedy algorithm
2D dynamic programming
1D dynamic programming
Divide and conquer
Which of the following problems can be solved using the longest subsequence problem?
Longest increasing subsequence
Longest palindromic subsequence
Longest bitonic subsequence
Longest decreasing subsequence
Consider the strings "PQRSTPQRS" and "PRATPBRQRPS". What is the length of the longest common subsequence?
9
8
7
6
Which of the following methods can be used to solve the longest common subsequence problem?
Recursion
Dynamic programming
Both recursion and dynamic programming
Greedy algorithm
What is the space complexity of Kadane's algorithm?
O(1)
O(n)
O(n^{2})
None of the mentioned
What is the time complexity of Kadane's algorithm?
O(1)
O(n)
O(n^{2})
O(5)
For which of the following inputs would Kadane's algorithm produce a WRONG output?
{1,0,-1}
{-1,-2,-3}
{1,2,3}
{0,0,0}
For which of the following inputs would Kadane's algorithm produce the INCORRECT output?
{0,1,2,3}
{-1,0,1}
{-1,-2,-3,0}
{-4,-3,-2,-1}
Kadane's algorithm uses which of the following techniques?
Divide and conquer
Dynamic programming
Recursion
Greedy algorithm
Kadane's algorithm is used to find ____________
Longest increasing subsequence
Longest palindrome subsequence
Maximum sub-array sum
Longest decreasing subsequence
Which technique is used by line 7 of the above code?
Greedy
Recursion
Memoization
Overlapping subproblems
Which property is shown by line 7 of the above code?
Optimal substructure
Overlapping subproblems
Both overlapping subproblems and optimal substructure
Greedy substructure
What is the space complexity of the recursive implementation used to find the nth fibonacci term?
O(1)
O(n)
O(n^{2})
O(n^{3})