[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 ...
随机推荐
- dojo grid 编辑问题
今天dojo grid编辑小问题,找了半天才找到问题, 1.问题 2.原因 数据单元没有索引列->id 3.修改前代码 <!DOCTYPE HTML> <html lang=& ...
- [整理]一个有关Latch(锁存器)的有趣问题
起源 今天诳论坛,突然发现了一个有关latch的问题,由于对D Flip-Flop和Latch还有些疑问,就点击了进去,一看果然有些意思,也挺有学习意义的,于是本文就诞生了.喊出口号~Just not ...
- docker--buildbot安装
curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname - ...
- ios UILabel在storyBoard或xib中如何在每行文字不显示完就换行
大家知道怎么用代码让label中的文字换行,只需要 label.numberOfLines = 0; label.text = @"这是第一行啦啦啦啦,\n这是第二行啦啦,\n这是第三行&q ...
- SharePreference 工具类封装
import java.util.List;import java.util.Map;import java.util.Set;import com.alibaba.fastjson.JSON;imp ...
- Mapped Statements collection does not contain value fo
Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...
- java web(spring mvc) 获取请求host 和 如何获取静态页的相对路径
1.获取请求host StringBuffer url = request.getRequestURL(); String tempContextUrl = url.delete(url.length ...
- POJ 1149PIGS 网络流 最大流
PIGS Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 20421 Accepted: 9320 Description ...
- Java 基本数据类型(新手必看资料)
变量就是申请内存来存储值.也就是说,当创建变量的时候,需要在内存中申请空间. 内存管理系统根据变量的类型为变量分配存储空间,分配的空间只能用来储存该类型数据. 因此,通过定义不同类型的变量,可以在内存 ...
- odoo 10 生产自动领料
分析源码 当 原材料的 补货规则 的 "补货位置" location_id 是 生产单 的 原材料 "目标位置 ", 并且 原材料的 补货规则 的 " ...