Write a recursive method named editDistance that accepts string parameters s1 and s2 and returns the "edit distance" between the two strings as an integer. Edit distance (also called Levenshtein distance) is defined as the minimum number of "changes" required to get from s1 to s2 or vice versa. A "change" can be defined as a) inserting a character, b) deleting a character, or c) changing a character to a different character. Call Value Returned editDistance("driving", "diving") 1 editDistance("debate", "irate") 3 editDistance("football", "cookies") 6

Answers

Answer 1

Answer:

Explanation:

The following code takes in the two parameters s1 and s2 and returns the Levenshtein distance of the two strings passed.

def editDistance(s1, s2):

   m = len(s1) + 1

   n = len(s2) + 1

   arr = {}

   for x in range(m):

       arr[x, 0] = x

   for y in range(n):

       arr[0, y] = y

   for x in range(1, m):

       for y in range(1, n):

           proc = 0 if s1[x - 1] == s2[y - 1] else 1

           arr[x, y] = min(arr[x, y - 1] + 1, arr[x - 1, y] + 1, arr[x - 1, y - 1] + proc)

   return arr[x, y]

Write A Recursive Method Named EditDistance That Accepts String Parameters S1 And S2 And Returns The

Related Questions

also have a good day people !!

Answers

Answer:

Thx u2!!

Explanation:

Everyone have a good day!

Answer:

You too and thank you for 50 points!!

Explanation:

why should information technology NOT be taught in school?​

Answers

Explanation:

Technology should not be used to teach in school as it can lead to distractions. With kids wanting to explore other sights, cheating, and communicating with others. Also, it can be expensive to purchase the technology for everyone as it can be a major investment with hundreds or thousands going into it. Technology also requires a lot of training by having to adapt lessons compatible with the systems and making sure the software is secure.

essence of radio program​

Answers

Answer:

Radio has the ability to reach across borders and can become a valuable source of information where reliable news is scarce. Radio has proved its worth in times of emergency such as when access to the mobile network is down as a result of an overload, or phone lines are cut.

Explanation:

PLEASE HELP WILL GIVE BRAINLIEST

Answers

Answer:

Explanation: answer is b) the row comes first  in the  element of an index

write any two reasons why files are stored in folders​

Answers

Answer:

Explanation:

The answer is The tree structure suggests the main benefit of folders: to organize your files. You can create folders to store and organize your pictures, your documents, your videos, and so on. Folders are also used to separate the files created by different users.

Answer:

Putting files into folders can help you stay organized and keep your files seperated. Having seperate place for different files make them easy to find. Having folders for your files also make them easier to move, for example, if you are moving your information to a new device, it is faster and more efficient because your files are placed in folders, so you don't have to move each indviual file.

I hope this was helpful! =)

Drag the tiles to the correct boxes to compete the pairs. Identify the types of chemical reactions occurring in the chemical equations.

Answers

The question is incomplete. The complete question is :

Drag the tiles to the correct boxes to compete the pairs. Identify the types of chemical reactions occurring in the chemical equations.

combustion reaction , photosynthesis , respiration

water + carbon dioxide + sunlight → oxygen + glucose

methane + oxygen → water + carbon dioxide + heat

glucose + oxygen → carbon dioxide + water + energy

Solution :

The chemical reactions that is occurring in the following chemical equations are :

Photosynthesis

water + carbon dioxide + sunlight → oxygen + glucose

Plants uses the light energy from the sun in the presence of water and carbon dioxide produces food by the process of photosynthesis. It produces glucose and oxygen.

Respiration

glucose + oxygen → carbon dioxide + water + energy

The cellular respiration process produces ATP with the breakdown of the glucose and oxygen. During respiration process, carbon dioxide is obtained along with water and energy.

Combustion reaction

methane + oxygen → water + carbon dioxide + heat

Combustion reaction is a chemical reaction in which methane is the main ingredient. Combustion takes place as things burn in the presence to methane and oxygen to form carbon dioxide, water and heat.

how important the role of valet and butler service in the hospitality

Answers

very important bc they help you with what you need.

Hardware refers to programs and protocols used on a computer system.

True
False

Answers

Answer:

False

Explanation:

Answer:

false

Explanation:

i JUST took the quiz

Write down a scratch program which:
performs the following tasks 5 times:
1. asks the user to input numbers
2. add the numbers in total variable
3. outputs the result

Answers

What computer language?

PLEASE HELP !!!!!!!!!!!!!
What is revising?

Answers

Answer:

Revision literally means to “see again,” to look at something from a fresh, critical perspective. It is an ongoing process of rethinking the paper: reconsidering your arguments, reviewing your evidence, refining your purpose, reorganizing your presentation, reviving stale prose.

Match each operating system drawback to its respective operating system.

1. more susceptible to viruses Linux. Operating System
2. fewer compatible applications Microsoft Windows Operating System
3. limited support system Apple Operating System

Answers

Answer:

Microsoft Windows - More susceptible to viruses

Linux - Limited support system

Apple - Fewer compatible applications

Explanation:

Generally windows is more susceptible to viruses.

Linux is open source meaning it's up to the community to help you.

Apple has been supporting more applications in these coming years but it still lacks the wide range of apps windows supports.

Answer:

1. Microsoft Windows is more susceptible to viruses

2. Mac OS X (Apple OS) has fewer compatible applications

3. Linux OS has a limited support system.

What is the dark, sticky substance that forms when tobacco is burned?

Answers

Answer: Tar.

Explanation:

A chemical substance made when tobacco is burned. Tar contains most of the cancer-causing and other harmful chemicals found in tobacco smoke. When tobacco smoke is inhaled, the tar can form a sticky layer on the inside of the lungs.

A man-in-the-middle attack or impersonation are likely to result in problems with

data availability.

data confidentiality.

data integrity.

data mining.

Answers

Answer:

Data Confidentiality

Explanation:

A Man-In-The-Middle-Attack (MITM) is an attack when a hacker gets between a communicative situation and digitally eavesdrops.

A man-in-the-middle attack or impersonation is likely to result in problems with data confidentiality. Thus, option B is correct.

What is a  man-in-the-middle attack?

A man-in-the-middle (MITM) attack is a broad name used whenever an abuser inserts himself into a conversation between a user and now an application. That will listen in on the conversation or to pretend to be one of the participants and create the impression that normal information-sharing is taking place.

Attacks compromise the integrity and confidentiality of exchanges, which exposes information, technology, and other things to malevolent use. Consider the threat if a hacker was able to remotely open an automatic door lock or deploy the airbags in a linked car.

Therefore, option B is the correct option.

Learn more about man-in-the-middle attack, here:

https://brainly.com/question/13014110

#SPJ6

Kevin created a scene in an animation where he shows a leaf falling slowly. Which principle of animation did he follow in doing so? Kevin is using the principle of ____. This principle is proportional to the _____ of the objects displayed. Answers given for the first: Arcs, Timing, Staging Answers given for the second: Height, Length, Speed

Answers

Answer:

Kevin is using the principle of Timing. This principle is proportional to the Speed of the objects displayed.

Explanation:

Timing is one of the principles of animation wherein the speed of the movement of an object is controlled by the animator and made to harmonize with certain effects such as sounds. In an example of some projected balls we find that when getting to the peak, their movement is slower compared to when they are coming down.

Speed plays a key role here. This is similar to the slowly falling leaf. Speed and timing are major considerations. When paired with good sounds, the animation comes off better.

JAVA

Write a method that takes 2 parameters: an ArrayList list, and an int numRepeats representing the number of times to repeat each element in the array.


Return a new ArrayList with each element repeated numRepeats times.


For example, if we had an ArrayList list with the values ["hello", "world"]:


repeatElements(list, 3)

Should return a new ArrayList with the elements:


["hello", "hello", "hello", "world", "world", "world"]


public ArrayList repeatElements(ArrayList list, int numRepeats)

{


}

Answers

Answer:

Explanation:

The following Java code creates the repeatElements method as requested and uses the test case shown in the question to test the method. The output can be seen in the attached picture below.

import java.util.ArrayList;

class Brainly {

   public static void main(String[] args) {

       ArrayList list = new ArrayList();

       list.add("Hello");

       list.add("World");

       System.out.println(repeatElements(list, 3));

   }

   public static ArrayList repeatElements(ArrayList list, int numRepeats) {

       ArrayList newList = new ArrayList();

       for (Object x:list) {

           for (int i = 0; i < numRepeats; i++) {

               newList.add(x);

           }

       }  

       return newList;

   }

}

Computer programmers must be fluent in every programming language. (5 points)
O True
O False

Answers

Answer:

False, its true that they need to know some programming languages but they do not need to be fluent in all of them.

Harrison works in a manufacturing unit and oversees the logistics, including the daily shipping of a large number of packages. Which information system will he use in the unit to keep track of the deliveries?

Answers

Answer:

E. Transaction processing system

Explanation:

Explanation: He will need a transaction processing system to know the amount of logistics available daily and how many to ship and how many to order. Transaction processing system will make him keep track of what transactions take place during the various days to help him give a good report.

the main work area of the computer is the

Answers

Answer:

Desktop

Explanation:

The desktop is the main work area of your computer, and will likely be the most visited area of your computer. Your desktop appears every time you log into your account, and contains icons and shortcuts to your most used programs and files.


what is the answer???​

Answers

Answer:

I think it should be C

Explanation:

A group of two or more computers that are link together.

Can you use 2 wireless keyboards and 2 wireless mouse on a dual monitor desktop without interfering with the other monitor ?

Answers

Answer:

I'm pretty sure this is not possible on Windows OS.

Explanation:

Two different monitors can work, as you probably know, but I don't think you can use separate keyboards and mice on the same machine.

How might you develop a game where players need strong twitch skills in a way that still makes the game fun for players of all skill levels and abilities?

Answers

Answer:

here ya go

Explanation:

I would suggest either having a default difficult being easy, and if people want to be challenged they can increase it, or try to balance how much of the game requires strong twitch skills.

A DTP firm has published and printed fliers for an upcoming fundraising event. In which section of the flyer would you find the contact details of the DTP firm
A. Body
B. Credits
C. Navigation
D. Title

Answers

B.Credits at the end of the flyer

Twenty staff members will be doing data entry activities from 10 p.m. to 3 a.m. on a regular basis. You could check if a given operating system will handle this activity by performing _____.

soak testing.
stress testing
load testing
spike testing

Answers

Answer:

load testing

Explanation:

to see if the activity can handle under performance

A laptop has an Nvme drive (C:) and a mechanical hard drive (D:), when the user notice that the D: drive is not there.
what should the technician do to see if the drive is recognized by the OS?

Answers

Answer:

Explanation:

The user should type in the search bar at the bottom right of the taskbar the following keywords, Create and format hard disk partitions and click on the option that appears with the same name. This will open Disk Management which will give information on all of the different storage options that the computer has installed. If the OS is detecting and recognizing the drive it will appear here. Many times the drive does not appear because it does not have a drive letter assigned to it. This can be assigned to the drive from the Disk Management.

What can be written to perform a certain number of iterations or to iterate until a specific result is achieved?

Answers

so in coding we use a thing called a loop to one of the most common loops is a if or loop this is when we tell the software to keep trying the task that is in the loop until it completes the task.

-scav

Type the correct answer in the box. Spell all words correctly.
Alan maintains the efficiency of a printing plant by supervising plant operations and implementing safety procedures. What does he work as?
Alan is working as a _____________.

Answers

Answer:

Alan is a Maintenance Supervisor.

Explanation:

Answer:

printing plant manager

Explanation:

z 1
-- = --
7 21
solve​

Answers

Answer:

[tex]z= \frac{1}{3}[/tex]

Explanation:

Given

[tex]\frac{z}{7} = \frac{1}{21}[/tex]

Required

Solve

[tex]\frac{z}{7} = \frac{1}{21}[/tex]

Multiply both sides by 7

[tex]7 * \frac{z}{7} = \frac{1}{21} * 7[/tex]

[tex]z= \frac{1}{21} * 7[/tex]

Rewrite as:

[tex]z= \frac{1 * 7}{21}[/tex]

[tex]z= \frac{7}{21}[/tex]

Simplify fraction

[tex]z= \frac{1}{3}[/tex]

Sasha has just gotten a new job in a nearby city. After
comparison shopping, she found that renting a nice two-
bedroom apartment would cost around $800 per month.
Her utilities would cost about $150 per month.
Sasha has enough money saved for a down payment, and
she found that she can buy a three-bedroom house or
condo with a mortgage payment of $1,000 per month,
including taxes and homeowner's insurance. Her utilities
would cost about $200 per month.
Sasha's new.company has told her that she will be
required to move at her own expense in two years.
What should she consider before making her decision?
The monthly costs of renting and buying
The extra expenses needed for maintenance while
she lives in the house.
The amount of the down payment she will need to
make
The expense of selling the home when she leaves
the city

Answers

where is the question??

Explanation:

The Quick Access Toolbar is typically
located in the top-right corner of the
window, above the ribbon.
True
False

Answers

Answer:

False

Explanation:

It is on the left

it is false hey a so it’s a

always follow the routine "clean up while in use and clean up before keeping it".

true or false​

Answers

This answer out of the true or false or true
Other Questions
Under her cell phone plan, Nevaeh pays a flat cost of $46.50 per month and $5 per gigabyte, or part of a gigabyte. (For example, if she used 2.3 gigabytes, she would have to pay for 3 whole gigabytes.) She wants to keep her bill under $55 per month. What is the maximum whole number of gigabytes of data she can use while staying within her budget? In stroke play you win the golf game if you take _________.takes the fewest number of strokes.takes the highest number of strokes.wins the most holesgets par on the most holes. pls help i really need it!!!!!i'm writing an essay and i need help on it. My brain hurts and can't think, i'm really tiered and need to go to bed since i have a SAT test tomorrow morning. I need a good night rest cause its really late out here and would appreciate your help.could you pls give me some facts of sentences.pls take this seriously, i really need it. Explain what political system are HELPPPPP ME PLS lol lol lol lol Why might throwing caution to the wind be a bad thing? in the flight of icarus answer both asap pls will give brainliest ! Dominic observes the number of birds that come to the feeder each day for aweek. If the range is 15, what is a possible value of n? i need help with this no link pls helpppp lol two questions The sides of a whiteboard are 20 inches by 10 inches. How many 2 inch by 2 inch Post-it notes will be needed to cover the entire whiteboard? Which describes the correlation shown in the scatterplot? 6 5 4 3 2 1 0 1 2 3 3 4 4 5 6 Are the pink arcs congruent? Should a government/religion control people's lives? Using the vocabulary usury, predestination, and Calvinism. Please help!!! 1. In the diagram, the arrow #9 is pointing to an organelle calledmitochondrianucleussmooth endoplasmic recticulumendoplasmic recticulum How do you decide what numbers to use as the numerator and the denominator in each equivalent fraction to the given decimal? HEY CAN ANYONE PLS PLS PLS ANSWER SPANISH WORK!!! The area of a rectangle is 8w + 18 square feet. The length of the rectangle is 2 feet. Use factoring to write an expression to represent the width of the rectangle. Teamwork definition +advantages and disadvantages ? Which word signals a cause?thenO sinceO thenO soO therefor