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
Renée’s job entails using a company laptop to constantly open other peoples’ workbooks, sorting the data, importing a new sheet
nevsk [136]

she should leave and go somewhere else for a mminute to cool and then come backa nd close tabs.

6 0
3 years ago
Important of microcomputer in some point​
Sedbober [7]

Answer:

A microcomputer uses memory to store the programs that control its operation, to store data waiting for processing, and to store the results of operations performed by the CPU. Primary memory, or storage, is electronic memory that is directly addressable by the CPU.

Explanation:

brainliest plzzzzzzz

8 0
3 years ago
Read 2 more answers
There are many different computer peripherals that are available to optimize your computing system’s specific needs. A graphic d
Rashid [163]

Answer:

Jamal could use a drawing pad. He could draw things out with a stylus and have it on his PC to manipulate. They cost as little as $40.

Felicia could use a mechanical keyboard. Although these are better for nearly everyone, someone who is doing a lot of typing and needing both speed and accuracy should get one. They start at around $50.

Credence could use a printer to print out work to hand in when needed. A decent one starts at around $100.

8 0
3 years ago
Does learning swift is hard? more than android?
ladessa [460]
No it is not. it's quite simple when you get the hang of it
4 0
4 years ago
Write a short note on pen drive​
lbvjy [14]

Answer:

They are called "flash drive" because they use flash memory to store files. Other common names for a flash drive include pendrive, thumbdrive or simply USB. USB flash drives have some advantages over other portable storage devices.A pen drive is a portable Universal Serial Bus (USB) flash memory device for storing and transferring audio, video, and data files from a computer. A pen drive usually has a large storage capacity and provides quick data transfers.

8 0
4 years ago
Other questions:
  • Need answer quick
    9·1 answer
  • What type of traffic always goes to all devices in a subnet?
    10·1 answer
  • Security measures are sometimes described as a combination of physical, technical, and administrative (PTA) safeguards. Which of
    12·1 answer
  • Write a function called show_info that takes a name, a home city, and a home state (a total of 3 arguments) and returns a full s
    12·1 answer
  • Write a function MaxMagnitude with two input parameters, that returns the largest-magnitude value. If the inputs are 5 7, the fu
    14·1 answer
  • Plez answer this
    10·1 answer
  • Swapping as applied in memory management with an aid of a diagram​
    13·1 answer
  • Hola buenas tardes, mi problema es el siguiente, en Word quiero alinear los párrafos por separado, pero, así lo sombree una line
    8·1 answer
  • Add the following numbers in abacus 2436+9214​
    8·1 answer
  • Where can you get information on receiving financial help?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!