Problem Introduction

The edit distinct between two strings is the minimum number of insertions, deletions and mismatches in an alignment of two strings.

Problem Description

Task.The goal of this problem is to implement the algorithm for computing the edit distance between two strings.

Input Format.Each of the two lines of the input contains a string consisting of lower case latin letters.

Constraints.The length of both strings is at least 1 and at mot 100.

Output Format.Output the edit distance between the given two string.

Sample 1.
Input:

ab
ab

Output:

0

Sample 2
Input:

short
ports

Output:

3

Sample 3
Input:

editing
distance

Output:

5

Solution

[UCSD白板题] Compute the Edit Distance Between Two Strings的更多相关文章

  1. [UCSD白板题] Longest Common Subsequence of Three Sequences

    Problem Introduction In this problem, your goal is to compute the length of a longest common subsequ ...

  2. [UCSD白板题] Primitive Calculator

    Problem Introduction You are given a primitive calculator that can perform the following three opera ...

  3. [UCSD白板题] Points and Segments

    Problem Introduction The goal in this problem is given a set of segments on a line and a set of poin ...

  4. [UCSD白板题] Maximize the Value of an Arithmetic Expression

    Problem Introduction In the problem, your goal is to add parentheses to a given arithmetic expressio ...

  5. [UCSD白板题] Take as Much Gold as Possible

    Problem Introduction This problem is about implementing an algorithm for the knapsack without repeti ...

  6. [UCSD白板题] Number of Inversions

    Problem Introduction An inversion of a sequence \(a_0,a_1,\cdots,a_{n-1}\) is a pair of indices \(0 ...

  7. [UCSD白板题] Sorting: 3-Way Partition

    Problem Introduction The goal in this problem is to redesign a given implementation of the randomize ...

  8. [UCSD白板题] Majority Element

    Problem Introduction An element of a sequence of length \(n\) is called a majority element if it app ...

  9. [UCSD白板题] Binary Search

    Problem Introduction In this problem, you will implemented the binary search algorithm that allows s ...

随机推荐

  1. spring 异常记录

    1.异常: java.lang.IllegalArgumentException: No converter found for return value of type: class java.ut ...

  2. jquery设置自己的标识符

    $(function(){ var $jc=jQuery.noConflict(); $jc('.main').css({'margin':'0 auto'}) })

  3. Ruby-模块和类

    首先看下他们的关系 irb(main):100:0> String.class => Class irb(main):101:0> String.class.superclass  ...

  4. (转载)HTML5 LocalStorage 本地存储

    原文地址:http://www.cnblogs.com/xiaowei0705/archive/2011/04/19/2021372.html HTML5 LocalStorage 本地存储 说到本地 ...

  5. tesseract配置过程

    tesseract配置过程: 1. 为了避免配置环境变量,可以先下载一个 tesseract-ocr-setup-3.02.02.exe(tesseract配置文件夹里有),然后安装(假设安装目录为D ...

  6. [整理]Matlab之中心平滑滤波

    滑动平均(moving average):在地球物理异常图上,选定某一尺寸的窗口,将窗口内的所有异常值做算术平均,将平均值作为窗口中心点的异常值.按点距或线距移动窗口,重复此平均方法,直到对整幅图完成 ...

  7. C++ Primer Plus 笔记记录

    (一) /a 这个转移字符竟然能调用计算机的硬件 喇叭~~ 对于float c++只能保证6位有效数字 似乎 double是13位 cout.setf(ios_base::fixed, ios_bas ...

  8. hadoop-mongo map/reduce java

    官方 http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-hadoop/ mongo-haoop项目地址 https://g ...

  9. python获取路径

    #!/usr/bin/env python import os #文件所在路径(模块路径) print __file__,os.path.realpath(__file__),os.path.absp ...

  10. PHP向mysql中插入数据的方法

    require "database.php"; $po_code = "YMWF2015-6-25-1"; $customer = "youmei&q ...