[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 ...
随机推荐
- maxiang.io css
/**设置你自己的CSS.例如:h1 { border-bottom: 1px solid #ccc; line-height:1.6;}body { background:#FDFFD0} **/p ...
- 《锋利的jQuery》(第2版)读书笔记4
第9章 jQuery Mobile jQuery Mobile是用来填补jQuery在移动设备应用上的缺憾的一个新项目. 它基于jQuery框架并使用HTML5和CSS3这些新的技术,除了能提供很多基 ...
- jQuery与Ajax的应用——《锋利的jQuery》(第2版)读书笔记3
第6章 jQuery与Ajax的应用 jQuery对Ajax操作进行了封装,在jQuery中$.ajax()方法属于最底层的方法,第2层是load().$.get()和$.post()方法,第3层是$ ...
- linux用户管理
管理用户的文件 添加用户组 添加用户 修改权限
- mouseChildren启示
将aSprite的 mouseChildren 属性设置为 false ,可以实现mouseClick 事件的目标为 aSprite对象,而不是其子对象中的任一个.
- SQL Server 查询表备注信息的语句
--name 字段名称--user_type_id --max_length 最大长度--is_nullable 是否允许空--remark 描述SELECT c.name, c.user_ty ...
- 如何去掉Eclipse里面自动追加的一些注释!!!内详
比如我创建一个类,勾选了自动生成main函数.他就来一个// TODO Auto-generated method stub比如我输入"try"然后自动补完try catch bl ...
- DailyRollingFileAppender的使用
DailyRollingFileAppender是日志记录软件包Log4J中的一个Appender,它能够按一定的频度滚动日志记录文件. 如果您不熟悉Log4J,建议阅读一下 使用Log4j进行日志记 ...
- KVC
KVC可以修改私有的属性,估计也是底层 操作的.
- XAF学习笔记之-多表头设计
空闲之余,看了下全英文的DEV 的XAF帮助文档,一半的英文我认识他,一半的英文他认识我,反正拆开成26个字母我全认识 不那么啰嗦了,先看效果 如何做:分以下几步 第一步:打开这个文件,这个文件就是X ...