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
Fill in the blank
EastWind [94]

Answer:

It is called the ENQUIRE database

Explanation: got it right boooiiiii

7 0
3 years ago
Read 2 more answers
A site structure that contains multiple links to individual pages, allowing visitors to go through multiple paths to the site is
DanielleElmas [232]

Answer:

A site structure that contains multiple links to individual pages, allowing visitors to go through multiple paths to the site is called <u>Multidimensional website architecture</u>

Explanation:

There are different types of website architecture. One of them is multidimensional website architecture. In Multidimensional architecture, Multiple links of the websites pages are given on the a page and each page contain the multiple links of the website. in this architecture from any page of the website we can access the other page of the website.

for example

On Wikipedia, we search some topic named as website architecture, the website architecture shows on the screen. On this page, there are different link of pages such as sequential website architecture, multidimensional website architecture and Hierarchical website architecture. If click one of the link such as Hierarchical website architecture, the page of Hierarchical website architecture will open and show on the screen. This page also contains different pages links. These links may include the main page link of website architecture. This is called Multidimensional Architecture.

7 0
3 years ago
The ____ command will confirm the system directory that you are currently in
stira [4]
Im pretty sure the answer is PWD
7 0
3 years ago
GUYSSS!!!
otez555 [7]
Yea, I don’t think you can fix it unless you backed it up or something somehow...
8 0
3 years ago
Read 2 more answers
What does the following code do? Assume list is an array of int values, temp is some previously initialized int value, and c is
BigorU [14]

Answer:

Option D is correct.

Explanation:

Option D is correct because  when the condition  if (list[j] < temp) is tested it only gets true when element in list[] array at <em>jth</em> position is less than the value in <em>temp</em> and after that it increments the value of c by this statement: c++ and so c is incremented from 0 to as much times as much elements in list[] are lesser than temp.

6 0
3 years ago
Read 2 more answers
Other questions:
  • What are some options available when using the Replace feature?
    13·1 answer
  • What are examples of educational obstacles to a career plan?
    13·1 answer
  • What fields of engineering are in Biomedical
    7·1 answer
  • Using a cell phone while operating a motor vehicle is considered distraction because
    8·1 answer
  • The hardware to keep the output data when finished is a
    9·1 answer
  • What does social protocol means in network?
    9·1 answer
  • (10 points) A stopwatch has three states named Zero, Running, and Stopped. There are two buttons, named B1 and B2. For each butt
    13·1 answer
  • Discuss the difference between a broad internet search and a narrow internet search?
    12·2 answers
  • 4.2 lesson practice last one plzs help
    5·2 answers
  • What will the following code display? int numbers[4] = { 99, 87 }; cout &lt;&lt; numbers[3] &lt;&lt; endl; a. 87 b.0 d. 34. What
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!