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. machine learning----->Amazon Machine Learning机器学习平台

    参考资料: 1.如何使用Amazon Machine Learning平台构建你的机器学习预测模型 2.

  2. jquery each遍历节点使用

    ---恢复内容开始--- $("#aaa :input[type='text']").each(function(i){     alert(this.value); this.v ...

  3. Android程序crash处理

    Android程序crash处理 时间 2014-11-24 13:45:37  CSDN博客 原文  http://blog.csdn.net/allen315410/article/details ...

  4. 对Hadoop体系的一点认识

    前言:Hadoop体系核心大多源自Google的思想,里面的思想的确很精彩!比如分布式计算,云的思想等,比起其他简单技术,更使得我想写这文章, 虽然这个东东在一般公司不可能用到! 首先由于hadoop ...

  5. Gradle笔记系列(二)

    1.使用Gradle命令行 在这篇博客中,我们将简要介绍Gradle命令行的使用. 1.1 执行多任务 通过在命令行列出每个任务(task),你可以在一次构建(build)中执行多个任务.例如,命令g ...

  6. 关于meta标签

    一.Meta标签中的format-detection属性及含义 意为:格式检测 或许你会有这样的经历:当你在制作手机端的页面中,点击了没有加任何链接的格式的数字时,这时手机会进行自动拔号提示操作! 禁 ...

  7. C++中数据对齐

    大体看了看数据对齐,不知道是否正确,总结如下: struct A { char name; double dHeight; int age; }; sizeof(A) = (1+7+8+4+4) =  ...

  8. WINDOWS下绑定ARP绑定网关

    一.WINDOWS下绑定ARP绑定网关步骤一:在能正常上网时,进入MS-DOS窗口,输入命令:arp -a,查看网关的IP对应的正确MAC地址, 并将其记录下来.注意:如果已经不能上网,则先运行一次命 ...

  9. SQL Server 常用函数

    1.DATEADD 在向指定日期加上一段时间的基础上,返回新的 datetime 值. 语法 DATEADD ( datepart , number, date ) 参数 datepart 是规定应向 ...

  10. phpredis中文文档 [转]

    phpredis是php的一个扩展,效率是相当高有链表排序功能,对创建内存级的模块业务关系 很有用;以下是redis官方提供的命令使用技巧: 下载地址如下: https://github.com/ow ...