Data Structures Algorithms-II MCQs

Page No. 107

Longest common subsequence is an example of ____________


aGreedy algorithm


b2D dynamic programming


c1D dynamic programming


dDivide and conquer



Which of the following problems can be solved using the longest subsequence problem?


aLongest increasing subsequence


bLongest palindromic subsequence


cLongest bitonic subsequence


dLongest decreasing subsequence



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


a9


b8


c7


d6


View Answer 7

Which of the following methods can be used to solve the longest common subsequence problem?


aRecursion


bDynamic programming


cBoth recursion and dynamic programming


dGreedy algorithm



Longest palindromic subsequence is an example of ______________


aGreedy algorithm


b2D dynamic programming


c1D dynamic programming


dDivide and conquer



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


aTrue


bFalse


ceither A. or (b)


d None of these


View Answer True

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


aO(1)


bO(2n)


cO(n)


dO(n2)


View Answer O(2n)

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


a6


b7


c8


d9


View Answer 7

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


aA string that is a palindrome


bA string of length one


cA string that has all the same letters(e.g. aaaaaa)


dSome strings of length two



Which of the following is not a palindromic subsequence of the string “ababcdabba”?


a abcba


babba


cabbbba


dadba


View Answer adba

Goto Page No.

Page 107 of 149

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan