设A和B是长度相同的2个字符串。A和B的距离定义为相应位置字符距离之和。2个非空格字符的距离是它们的ASCII码之差的绝对值。空格与空格的距离为0;空格与其它字符的距离为一定值k。 字符串A的扩展是在A中插入若干空格字符所产生的字符串。在字符串A和B的所有长度相同的扩展中,有一对距离最小的扩展,该距离称为字符串A和B的扩展距离。 对于给定的字符串A和B,试设计一个算法,计算其扩展距离。
上传时间: 2014-12-22
上传用户:15736969615
回溯(b a c k t r a c k i n g)是一种系统地搜索问题解答的方法。为了实现回溯,首先需要为问题定义一个解空间( solution space),这个空间必须至少包含问题的一个解(可能是最优的)。在迷宫老鼠问题中,我们可以定义一个包含从入口到出口的所有路径的解空间;在具有n 个对象的0 / 1背包问题中(见1 . 4节和2 . 2节),解空间的一个合理选择是2n 个长度为n 的0 / 1向量的集合,这个集合表示了将0或1分配给x的所有可能方法。当n= 3时,解空间为{ ( 0 , 0 , 0 ),( 0 , 1 , 0 ),( 0 , 0 , 1 ),( 1 , 0 , 0 ),( 0 , 1 , 1 ),( 1 , 0 , 1 ),( 1 , 1 , 0 ),( 1 , 1 , 1 ) }。
标签: 搜索
上传时间: 2014-01-17
上传用户:jhksyghr
嵌入式文档:Xilinx EDK 实验教程3: Adding Custom IP to an Embedded System Lab:
标签: Embedded Xilinx Adding Custom
上传时间: 2013-12-15
上传用户:bakdesec
This module provides an introduction for our ELEC 301 DMT group project. 这是其中a2d模块部分
标签: introduction provides project module
上传时间: 2013-12-15
上传用户:685
LCD DRIVER AF-128 B
上传时间: 2014-12-22
上传用户:851197153
fbkldfmlb n/ovk,e vml bhdsrb mor brb n/sZPer b vk,epabho,l rnopazbhlrepofrt,epsho
标签: rnopazbhlrepofrt fbkldfmlb bhdsrb epabho
上传时间: 2014-01-25
上传用户:ANRAN
算法界里仅次于the art of computer programming的重量级书籍 压缩包里包含有introduction to algorithms的第二版英文版 习题解答与教师手册(非常难得)
标签: introduction programming algorithms computer
上传时间: 2013-12-19
上传用户:qwe1234
This design calculator uses to controls an attribute value the establishment, function skill and so on compilation, has met the practical requirements. Truly realized the contact surface succinctly, has been artistic, the function consummated, the unification goal.
标签: establishment calculator attribute controls
上传时间: 2015-09-22
上传用户:Yukiseop
steganography tools to hide a text file in an image in true colour.
标签: steganography colour image tools
上传时间: 2013-12-30
上传用户:c12228
Introduction to directx9 3d game programming 一书的源代码
标签: Introduction programming directx9 game
上传时间: 2013-11-29
上传用户:thesk123