設A和B是長度相同的2個字符串。A和B的距離定義為相應位置字符距離之和。2個非空格字符的距離是它們的ASCII碼之差的絕對值。空格與空格的距離為0;空格與其它字符的距離為一定值k。 字符串A的擴展是在A中插入若干空格字符所產(chǎn)生的字符串。在字符串A和B的所有長度相同的擴展中,有一對距離最小的擴展,該距離稱為字符串A和B的擴展距離。 對于給定的字符串A和B,試設計一個算法,計算其擴展距離。
上傳時間: 2014-12-22
上傳用戶:15736969615
回溯(b a c k t r a c k i n g)是一種系統(tǒng)地搜索問題解答的方法。為了實現(xiàn)回溯,首先需要為問題定義一個解空間( solution space),這個空間必須至少包含問題的一個解(可能是最優(yōu)的)。在迷宮老鼠問題中,我們可以定義一個包含從入口到出口的所有路徑的解空間;在具有n 個對象的0 / 1背包問題中(見1 . 4節(jié)和2 . 2節(jié)),解空間的一個合理選擇是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
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
This software designs the student result management system m ay replace the tedious low effect the manual management, has realized the result management, the information management and the curriculum manages three big cores functions.
標簽: the management software designs
上傳時間: 2013-12-15
上傳用戶:kr770906
This software designs the document management system may replace the tedious low effect the manual management, has used the c language programming, realized the document input to loan, the information management and the data compilation three big cores function
標簽: the management software document
上傳時間: 2013-12-20
上傳用戶:yt1993410
If we have two individually sorted vectors "a" and "b" but they are not sorted with respect to each other and we want to merge them into vector "c" such that "c" is also a sorted vector. Then c=mergesorted(a,b) can be used.
標簽: sorted individually respect vectors
上傳時間: 2015-09-23
上傳用戶:comua
The Mythical Man-Month: Essays on Software Engineering is a book on software project management by Fred Brooks, whose central theme is that "Adding manpower to a late software project makes it later."
標簽: Engineering management Man-Month Mythical
上傳時間: 2013-12-08
上傳用戶:songnanhua
EIA(ELECTRONIC INDUSTRIES ALLIANCE)標準文檔EIA-CEA-861-B,A DTV Profile for Uncompressed High Speed Digital Interfaces。
標簽: ELECTRONIC INDUSTRIES ALLIANCE EIA-CEA
上傳時間: 2015-09-27
上傳用戶:hphh
區(qū)域增長的算法實現(xiàn): 1)根據(jù)圖像的不同應用選擇一個或一組種 子,它或者是最亮或最暗的點,或者是位 于點簇中心的點 2...通過像素集合的區(qū)域增長 算法實現(xiàn): 區(qū)域A 區(qū)域B 種子像素增長.3)增長的規(guī)則 4) 結束條件.
上傳時間: 2015-09-30
上傳用戶:wcl168881111111