1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hram777 [196]
3 years ago
15

Write a recursive method called lengthOfLongestSubsequence(a, b) that calculates the length of the longest common subsequence (l

cs) of two strings. For example, given the two strings aaacommonbbb and xxxcommonzzz the lcs is common which is 6 characters long so your function would return 6. The length of the lcs of two strings a
Computers and Technology
1 answer:
kompoz [17]3 years ago
4 0

Answer:

Explanation:

The following code is written in Java and creates the recursive function to find the longest common substring as requested.

 static int lengthOfLongestSubsequence(String X, String Y) {

       int m = X.length();

       int n = Y.length();

       if (m == 0 || n == 0) {

           return 0;

       }

       if (X.charAt(m - 1) == Y.charAt(n - 1)) {

           return 1 + lengthOfLongestSubsequence(X, Y);

       } else {

           return Math.max(lengthOfLongestSubsequence(X, Y),

                   lengthOfLongestSubsequence(X, Y));

       }

   }

You might be interested in
Two DHCP servers, Server1 and Server2, are running Windows Server 2016. As the administrator, you create a scope called Scope1.
kumpel [21]

Answer:

The answer is "Option a"

Explanation:

Split-scope is also an easy and simple approach to deliver DHCP consistency and workload management into your system. Server 2008 R2 provides a convenient divide-scope guide which removes several operational efforts but can only be to use if all databases run on R2, and wrong choices can be described as follows:

  • In option b, It uses the Ip address for multicast, that's why it is wrong.
  • In option c, It is wrong because it uses a windows interface, that works on policies.  
  • In option d, It is wrong because it is an administrative feature.

5 0
3 years ago
Technical colleges offer certification in audio engineering through programs that are normally from 2 to 6 months long.
Murrr4er [49]

Answer:

False

Explanation:

i said so

8 0
3 years ago
The default case is required in the switch selection statement.
babunello [35]

Answer: False

Explanation:

 The given statement is false, as it is not compulsory that the default case is require in switch selection statement. If the default case are not properly specified in the statement then, there will be no execution occur in the switch selection statement.

It is sometimes good to have default case in switch selection statement, but it is not mandatory. The default case only executed when the correct case is present and none of the case matches in the given statement.

5 0
3 years ago
Which game title went on to become the highest selling unbundled cartridge game?
alexandr402 [8]

Answer:

Tetris

Explanation:

On June 6, 1984, the first version of Tetris was unveiled and quickly took the world by storm. While Tetris has appeared on every major gaming platform from the Commodore 64 to the iPhone, it arguably gained its greatest notoriety as the cartridge game bundled with the original Nintendo Game Boy.

5 0
2 years ago
What is MS Paint ?<br><img src="https://tex.z-dn.net/?f=%20computer" id="TexFormula1" title=" computer" alt=" computer" align="a
nignag [31]

Answer:

Microsoft Paint, also known as Paint, is a simple program that allows users to create basic graphic art on a computer. Included with every version of Microsoft Windows since its inception. Paint provides basic functionality for drawing and painting in color or black and white, and shaped stencils and cured line tools.

4 0
3 years ago
Other questions:
  • When inside a closed work environment, its okay to openly talk with co-workers about PII
    6·1 answer
  • Write a statement that adds 1 to the variable reverseDrivers if the variable speed is less than 0,adds 1 to the variable parkedD
    14·1 answer
  • What is the top folder of the file tree called
    5·2 answers
  • How to fix Please enable JS and disable any ad blocker
    13·2 answers
  • How to code on python
    8·2 answers
  • What devices gives input​
    5·1 answer
  • Identify two real-world examples of problems whose solutions do scale well
    13·1 answer
  • Consider the following declaration:
    9·1 answer
  • Describe accessibility in Windows 7 ​
    13·1 answer
  • If the disaster requires actions offsite from the primary infrastructure, it is under the jurisdiction of__________.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!