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
Each web site contains a(n) ____ page, which is the first document users see when they access the site.
katrin2010 [14]
Home is the answer. Hope this helps. :)
7 0
3 years ago
What type of object can offer the most effective way to display data and calculations in a presentation?
poizon [28]

This is definitely an opinion, but an excel you can do A and D and just about the same as B also

<u>So i'd say C </u>

8 0
2 years ago
20 points!!!!! Plz answer quickly
Elena L [17]

Answer:

other words are not clear

3 0
2 years ago
maximum cardinality indicates whether or not an instance of one entity class must be related to at least one instance of another
vladimir1956 [14]

This is false.

What is cardinality?

Cardinality refers to the entity instances for which it is eligible to participate in a relationship instance. There are two types of cardinality, maximum and minimum.

What is maximum cardinality?

  • The maximum cardinality of a relationship is the maximum number of instances of entity B that may be associated with each instance of entity A.
  • Maximum cardinality: maximum number of entity instances that can participate in a relationship.
  1. One-to-One [1:1]
  2. One-to-Many [1:N]
  3. Many-to-Many [N:M]

To know more about maximum cardinality , refer:

brainly.com/question/18090451

#SPJ4

4 0
1 year ago
A user logging on, an application server connecting to a database server, an authentication server rejecting a password, or an a
ser-zykov [4K]
<span>The answer is Event.  A user logging on, an application server connecting to a database server, an authentication server rejecting a password, or an antivirus scanner reporting a suspected virus are all examples of Event.
</span>
4 0
3 years ago
Other questions:
  • PLS HELP ASAP! WILL GIVE BRAINLIEST!
    14·1 answer
  • Advances in television broadcasting have created changes in millions of U.S. families in a. ​sleep habits. b. ​conversation patt
    5·1 answer
  • Create a style rule for the page body that sets the width to 95% of the browser window ranging from 640 pixels up to 960 pixels.
    11·1 answer
  • A user has been complaining that their wireless connection has been connecting and disconnecting too frequently. what command co
    15·1 answer
  • How should tools be stored <br>​
    13·1 answer
  • What would be an ideal scenario for using edge computing solutions?
    10·1 answer
  • Assume you are working for the laboratory that is developing the control system for the LISAsatellites. Your job is to develop a
    9·1 answer
  • Help plz!! I will mark brainliest
    15·2 answers
  • Write a program that calculates the average of N integers. The program should prompt the
    12·1 answer
  • Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!