[UCSD白板题] Compute the Edit Distance Between Two Strings
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的更多相关文章
- [UCSD白板题] Longest Common Subsequence of Three Sequences
Problem Introduction In this problem, your goal is to compute the length of a longest common subsequ ...
- [UCSD白板题] Primitive Calculator
Problem Introduction You are given a primitive calculator that can perform the following three opera ...
- [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 ...
- [UCSD白板题] Maximize the Value of an Arithmetic Expression
Problem Introduction In the problem, your goal is to add parentheses to a given arithmetic expressio ...
- [UCSD白板题] Take as Much Gold as Possible
Problem Introduction This problem is about implementing an algorithm for the knapsack without repeti ...
- [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 ...
- [UCSD白板题] Sorting: 3-Way Partition
Problem Introduction The goal in this problem is to redesign a given implementation of the randomize ...
- [UCSD白板题] Majority Element
Problem Introduction An element of a sequence of length \(n\) is called a majority element if it app ...
- [UCSD白板题] Binary Search
Problem Introduction In this problem, you will implemented the binary search algorithm that allows s ...
随机推荐
- docker安装
系统要求:需要一个64位的centos7操作系统和版本3.10或更高版本的Linux内核 开始安装: uname -r //查看内核版本yum -y update //更新系统更新到最新 #安装d ...
- jsp js action之间的传值
1.struts2 action如何向JSP的JS函数传值 action中定义变量public class TestAction extends ActionSupport implements Se ...
- 发现 git忽略没用
git rm --cached GuoJiWeb/Properties/PublishProfiles/Profile1.pubxml
- php 快速排序
快速排序是以其中一个数为比较标准,其他比较的数分块处理,应用递归按相同想法处理数据 比如:4 3 6 2 1 7 8 以4为比较对象 排序为 3 2 1 6 7 8 左边为 3 2 1 右边 为 6 ...
- 开源PLM软件Aras详解六 角色与用户以及权限
在Aras中,角色(Identity),用户(Users),权限(Permissions),分别为3个ItemType,Permissions依赖与Identity,Identity可依赖与User. ...
- DataInputStream和DataOutputStream
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInp ...
- 各大浏览器 CSS3 和 HTML5 兼容速查表
不知不觉中,支持 CSS3 和 HTML5 的浏览器变得越来越多,甚至包括最新版的 IE,当然,所谓支持仅仅是部分支持,因为 CSS3 和 HTML5 的W3C 规范都尚未形成.如果你现在就希望使用 ...
- h5弹框去掉ip地址
<script> window.alert = function(name){ var iframe = document.createElement("IFRAME" ...
- ajax 请求如何解决乱码
今天遇到一个问题,有关ajax 请求中传输中文,遇到乱码的问题. 如下代码: function UpdateFolderInfoByCustId(folderId, folderName, custI ...
- [转] AIX lv 4k偏移量
转自:http://www.aixchina.net/Question/29969 前几天在客户数据库做巡检的时候,在警告日志中发现有如下警告:引用WARNING: You are creating ...