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

unable to find valid certification path to requested target

Answers

Answer:

Explanation:

This issue might arise if you are using a self-signed certificate or a certificate that's been issued by an internal certificate authority, or if your clients (e.g., browser, Java) are outdated. Trust is handled by having the root and intermediate certificates of your SSL certificate on a trusted keystore.

who is considered as the father of computer?​

Answers

Charles Babbage is considered as the father of computer......

Answer:

Charles Babbage is considered the "Father of Computing"

2) State True or False. 1. Abacus is an electronic device. 2. ROM is read and writes memory of computer. 3. Header and footer appear at the top and bottom of 4. The first microprocessor is INTEL 4004. 5. CTRL + A is used to print data in M.S. word. Answer the following questions:​

Answers

Answer:

1 false

2 false

3 false

4  true

5 false

Explanation:

Answer:

False, True, True, True, False

Explanation:

1. False, it is a calculation device not electronic device.

2. True

3. True, Header appear at the top and Footer appear at the bottom.

4. True

5. False, Ctrl + A in MS Word or other text platforms is used to select all the text, not to print data in MS Word. To print data in MS Word or other text platforms we use Ctrl + P.

the fast speed of _______ available today enable computers to work very fast​

Answers

Answer:

main hardware components such as:

1. CPU

2. RAM

3. Motherboard (bus speed)

4. Hard drive

5. Video Card

6. Cache

7. Latest operating system (Windows XP, Windows 10, etc.)

Why would you browse by entering a URL rather than use a link in a Web page

Answers

Answer:

Rather than entering a URL in a web browser, I prefer to browse the webpage. Because if you do browse in the browser you can see other alternative options to that website.

_____ selling is used when a product is sold from one business to another .

Answers

Answer: cross-selling

Explanation: is the action or practice of selling an additional product or service to an existing customer. In practice, businesses define cross-selling in many different ways.

why does messenger keep saying waiting for network

Answers

you prob need to fix your data or redownload it again

search engines use software that combs the web to find webpages and add new data about them to the database. what is this software called?

Answers

Answer:

They basically use a technology called spider or web crawling, it basically just comb through the internet to find websites or webpages.

please give brainliest.

Difference between batabse and database management system

Answers

Answer:A database is an organized collection of structured information, or data, typically stored electronically in a computer system. A database is usually controlled by a database management system (DBMS). ... The data can then be easily accessed, managed, modified, updated, controlled, and organized.

Explanation:A database could be grades that students get at school and to manage it we can use a spreadsheet program like excel

where should the works cited page appear in the document?

Answers

Answer:

The Works Cited Page should be the last page of the documents (and it should be a separate page on its own, not just at the bottom of the essay).

How can we repair a head jack of a laptop charger.????​

Answers

Answer:

Step one turn off the laptop. And take out the battery step two remove the Phillips screw. And then take out the back. Cover. Step three remove four phillips screws. And then take out the hard.

Explanation:

Son las características de la topología anillo *
5 puntos
Opción 1 Todas las terminales son inteligentes.
Opción 2 Todas las terminales son brutas.
Opción 3 Todas las terminales almacenan.

Answers

The 3rd onee i think if not 4th

what level of system and network is required for cui

Answers

Answer:

CUI will be classified at a “moderate” confidentiality level and follow DoDI 8500.01 and 8510.01 in all DOD systems. Non-DoD systems must provide adequate security with requirements incorporated into all legal documents with non-DoD entities following DoDI 8582.01 guideline

Explanation:

what does your dns server might be unavailable mean?

Answers

Answer:

flush your dns

Explanation:

did someone hang themselves on set of wizard of oz

Answers

No - its a rumour that has been going around since the films 50th anniversary in 1989.

did someone actually hang themselves on the wizard of oz set

Answers

No - its a rumour started since the films 50th anniversary in 1989.

An advantage of a private home network is that is typically more secure than public Wi-Fi.

Answers

Answer:

yes it's true

Explanation:

please mark brainiest

Answer:

I agree on that.

Explanation:

Of course you can use a vpn to encrypt your data being sent to router but it is easier to just connect to a private network.

Hope this help please give the brainliest award would be much appreciated.

Please please help ASAP please

Answers

Answer:

he say yes would i do so way 2 be hey i oh peepo

Explanation:

Which options are available in the Conditional Formatting dialog box?

Answers

Answer:

all but b are correct.

Explanation:

what is the answer ?????​

Answers

Answer:

1) Driver or option D

2) Kindle or option C

Which of the following scenarios describes an IT professional using the Internet and computer system access in an unprofessional or inappropriate way? Check all of the boxes that apply.

checking social media networks during working hours

surfing the Internet during working hours for what to do on the weekend

downloading a favorite band’s latest album from a file-sharing service

Answers

Answer:

All of the above.

Explanation:

You shouldn't be doing any of these things using your employer's computer networks, even if there aren't any explicit rules against them. For one thing, your usage of company systems and networks is being continuously monitored, so you can forget about trying to get away with it. Checking social media and surfing the internet can expose parts of your personal life that you don't want anyone else to see, and downloading anything from anywhere is dangerous, especially if you're pirating music from some backwater site where adult sites and survey scams are waiting to bombard the whole network with pop-up ads. You should always do these things on your personal devices while connected to your personal home network.

A document used to convince a panel of potential funders to help a product, programor service become reality.

Answers

Answer:

Concept paper

Explanation:

only cool people answer this question.




are you cool?

Answers

Answer:

Yes

Explanation:

I like frogs

Answer:

always been coolswag

cui documents must be reviewed to which procedures before destruction?

Answers

Answer:

Documents containing CUI must be destroyed by shredding..

Explanation:

Hope it helps you..

Your welcome in advance..

(ㆁωㆁ)

The procedure before the destruction of the CUI document will be Records Management.

What is the CUI documents procedure?

Any CUI must go through the Records Management processes before it may be deleted. It must be determined if it is transient or persistent and then treated accordingly. Agencies are required to destroy CUI in a way that makes it unrecoverable, unreadable, and indecipherable, even when information is in electronic form.

Agencies are required to apply the procedure specified by law, legislation, or government-wide policy when destroying records. Cross-cut shredding that results in particles that are 1 mm x 5 mm (or less) in size or crushing are two techniques that have been authorized for eliminating paper-based CUI.

To acquire regulatory advice for records management and destruction processes, go to the course resources.

The CUI document must be reviewed to which procedures before destruction by Records Management.

More about the CUI documents procedure link is given below.

https://brainly.com/question/29871876

#SPJ12

how to get into someones phone without knowing the password iphone

Answers

Answer:

you should not do that unless you have a good reason to.

which kind of system software tells the computer how to communicate with peripherals, such as a printer or scanner?

Answers

The kind of system software that tells the computer how to communicate with peripherals, such as a printer or scanner, is known as "device driver."

A device driver is a set of computer programs or software files that run specific devices or gadgets to perform their designed functions while connected to the computer system.

A device driver is a form of software file that ensures hardware device functions as designed.

Several types of device drivers include:

BIOS;Motherboard Drivers;Hardware Drivers;Virtual Device Drivers.

Hence, in this case, it is concluded that the correct answer is Device Driver.

Learn more here: https://brainly.com/question/19473613

I will make you brainless Just answer this question!!

A. Arrange the follow stpes chronologically.Write A the first step,Bfor the second and so on.​​

Answers

Answer:

1. 3

2. 8

3. 2

4. 6

5. 4

6. 5

7. 9

8. 1

9. 7

Explanation:

Im not sure about this but I hope it helps

The number 8 is actually first

Automated Deployment is one of the prerequisite for DevOps Implementation.1. True2. False

Answers

True I think………………………..

Automated Deployment is one of the prerequisite for DevOps Implementation is a true statement.

Automated deployment

Automated deployment provides the ability to move your software between testing and production environments by using automated processes.

In other words, it allows organizations to release new features faster and more frequently.

Automated deployment allows faster approach to development, production  and deployment.

learn more on automated deployment: https://brainly.com/question/17052494

#SPJ2

what are the unique ICT needs for casinos?

Answers

Answer:

This is one of those slot game developers that not only create games, but it also creates entire platforms for online casinos and they have to pay for the games.

Explanation:

which are types of gradients to choose from when working in photoshop

Answers

Answer:

can anyone help me in computer

There are regulations in many nations requiring CUD-compliant graphics in public areas or colour vision deficit. Photoshop has two blindness settings: Protanopia-type (red-blindness) and Deuteranopia-type (green-blindness).

How might colour blindness be utilised in Photoshop?

Click See Proof Setup Color Blindness Protanopia-type/Color Blindness Deuteranopia-type to use it. Now, you can toggle it on and off simply using the Ctrl+Y key on a PC or the +Y key on a Mac.

To help with design, there are certain tools that imitate colour blindness. Change the document's colour mode to RGB (this mode provides the most accurate proofs for colour blindness) Select either Protanopia-type or Deuteranopia-type under View > Proof Setting > Color Blindness.

Therefore, There are regulations in many nations requiring CUD-compliant graphics in public areas or colour vision deficit. Photoshop has two blindness settings: Protanopia-type (red-blindness) and Deuteranopia-type (green-blindness).

To know more about Photoshop visit:-

brainly.com/question/30808560

#SPJ2

Other Questions
more than fifty miles per hour phrase or clause in the 90s, what defensive strategy was considered an "illegal defense"? What role was played by Poland in the fall of Eastern European communism? can someone help me with this? PROBABILITY QUESTIONA psychologist plans an experiment in which subjects draw an object based on a verbal description. For each trial, one person draws, one reads the description, and one records how long it takes to get a successful drawing.From a group of 8 people, in how many ways can the psychologist select a person to draw, a person to read, and a person to record time? what is atmospheric pressure What type of account is used to pay for daily expenses?1. Pending account 2. Available account 3. Savings account 4. Checking account need helpppp What is the interquartile range (IQR) of the data set represented by this boxplot?3845506875 What changes did Henry II make to the English legal system, and how did these changes affect feudalism What led to the deaths of Gaius and Tiberius Gracchus Please help with this math problem!! :) Will give brainliest!! In Unwind by Neal Shusterman, What are the heros journey steps?Please show page numbers. true or false, two figures are mathematically similar if the angles change by the same scale factor. Genevieve spent $56.25 to fill her 15-gallon tank. How much did she pay per gallon?A. $3.25B. $3.50C. $3.75D. $4.00 Pls help with my spanish work fast pls Why water can be unsafe in a pool? pleasee help meeee im awful at math Simplify 6-sqr25/4=.............. What is the definition of flat In which direction would you travel to get from the capital of New Mexico to the Capital of Texas en tus palabras q significa la expresion 'perdido en sus sueos' Steam Workshop Downloader