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. Android菜鸟成长记15 -- BitMap

    BitMap简介 Bitmap是Android系统中的图像处理的最重要类之一.用它可以获取图像文件信息,进行图像剪切.旋转.缩放等操作,并可以指定格式保存图像文件.本文从应用的角度,着重介绍怎么用Bi ...

  2. error-2016-2-15

    错误:该请求包含双重转义序列,而 Web 服务器上配置的请求筛选拒绝双重转义序列原因:一些URL中可能会包含+号等符号,然后IIS7以上的版本会默认拒绝请求此URL,需要进行如下的修改. 解决PHP中 ...

  3. Angularjs学习笔记(一)

    大部分传统的模板系统,对模板的渲染是个线性单向的过程:模板或变量与模板混合在一起产生结果的标记集合.任何对模型的改变都需要通过模板的重新计算.但AngularJS有所不同,任何用户引发的视图的改变,都 ...

  4. Hibernate报错:org.hibernate.ObjectNotFoundException: No row with the given identifier exists 解决办法

    报错信息: org.hibernate.event.internal.DefaultLoadEventListener onLoad INFO: HHH000327: Error performing ...

  5. JavaScript 详说事件机制之冒泡、捕获、传播、委托

    DOM事件流(event  flow )存在三个阶段:事件捕获阶段.处于目标阶段.事件冒泡阶段. 事件捕获(event  capturing):通俗的理解就是,当鼠标点击或者触发dom事件时,浏览器会 ...

  6. TCP协议学习记录 (一) ICMP时间戳请求

    程序只实现了获取时间戳,至于将时间戳转换成具体日期和时间,暂时没有好的办法. #define TIME_STAMP_REQUEST 13 struct iphdr { unsigned ; //包头长 ...

  7. 复制本地文件到HDFS本地测试异常

    项目中需要将本地文件拷贝到hdfs上,由于本人比较懒,于是使用擅长的Java程序通过Hadoop.FileSystem.CopyFromLocalFile方法来实现. 在本地(Window 7 环境) ...

  8. CentOS 6.5 RPM包方式安装 Mysql 5.6

    1. 下载MySQL 5.6 下载页面:http://dev.mysql.com/downloads/mysql/此处选择“Red Hat Enterprise Linux 6 / Oracle Li ...

  9. .net stream

    流的抽象基类Stream:Stream 是所有流的抽象基类.流是字节序列的抽象概念,例如文件.输入/输出设备.内部进程通信管道或者 TCP/IP 套接字.Stream 类及其派生类提供这些不同类型的输 ...

  10. survey on Time Series Analysis Lib

    (1)I spent my 4th year Computing project on implementing time series forecasting for Java heap usage ...