LCS(最長公共子序列)問題可以簡單地描述如下: 一個(gè)給定序列的子序列是在該序列中刪去若干元素后得到的序列。給定兩個(gè)序列X和Y,當(dāng)另一序列Z既是X的子序列又是Y的子序列時(shí),稱Z是序列X和Y的公共子序列。例如,若X={A,B,C,B,D,B,A},Y={B,D,C,A,B,A},則序列{B,C,A}是X和Y的一個(gè)公共子序列,但它不是X和Y的一個(gè)最長公共子序列。序列{B,C,B,A}也是X和Y的一個(gè)公共子序列,它的長度為4,而且它是X和Y的一個(gè)最長公共子序列,因?yàn)閄和Y沒有長度大于4的公共子序列。 最長公共子序列問題就是給定兩個(gè)序列X={x1,x2,...xm}和Y={y1,y2,...yn},找出X和Y的一個(gè)最長公共子序列。對(duì)于這個(gè)問題比較容易想到的算法是窮舉,對(duì)X的所有子序列,檢查它是否也是Y的子序列,從而確定它是否為X和Y的公共子序列,并且在檢查過程中記錄最長的公共子序列。X的所有子序列都檢查過后即可求出X和Y的最長公共子序列。X的每個(gè)子序列相應(yīng)于下標(biāo)集{1,2,...,m}的一個(gè)子集。因此,共有2^m個(gè)不同子序列,從而窮舉搜索法需要指數(shù)時(shí)間。
上傳時(shí)間: 2015-06-09
上傳用戶:氣溫達(dá)上千萬的
c語言版的多項(xiàng)式曲線擬合。 用最小二乘法進(jìn)行曲線擬合. 用p-1 次多項(xiàng)式進(jìn)行擬合,p<= 10 x,y 的第0個(gè)域x[0],y[0],沒有用,有效數(shù)據(jù)從x[1],y[1] 開始 nNodeNum,有效數(shù)據(jù)節(jié)點(diǎn)的個(gè)數(shù)。 b,為輸出的多項(xiàng)式系數(shù),b[i] 為b[i-1]次項(xiàng)。b[0],沒有用。 b,有10個(gè)元素ok。
標(biāo)簽: 多項(xiàng)式 曲線擬合 c語言 最小二乘法
上傳時(shí)間: 2014-01-12
上傳用戶:變形金剛
高精度乘法基本思想和加法一樣。其基本流程如下: ①讀入被乘數(shù)s1,乘數(shù)s2 ②把s1、s2分成4位一段,轉(zhuǎn)成數(shù)值存在數(shù)組a,b中;記下a,b的長度k1,k2; ③i賦為b中的最低位; ④從b中取出第i位與a相乘,累加到另一數(shù)組c中;(注意:累加時(shí)錯(cuò)開的位數(shù)應(yīng)是多少位 ?) ⑤i:=i-1;檢測i值:小于k2則轉(zhuǎn)⑥,否則轉(zhuǎn)④ ⑥打印結(jié)果
上傳時(shí)間: 2015-08-16
上傳用戶:源弋弋
Listed below are the typographical conventions used in this guide. – Example C++ code and commands to be typed by the user are in non-bold characters in typewriter font. – Items where the user has to supply a name or number are given in lower-case italic characters in typewriter font. – Sections marked with a ‡ describe features that are also available in ANSI C.
標(biāo)簽: typographical conventions commands Example
上傳時(shí)間: 2013-12-20
上傳用戶:xiaoxiang
The initial planning and thinking about this book began during a discussion of SQL Server futures in July 2001. The discussion was with Rob Howard during a trip to Microsoft to discuss the first book I was working on at that time. After that, I stayed involved in what was happening in ADO.NET by going to the SQL Server Yukon Technical Preview in Bellevue, Washington, in February 2002 and by working with the ASP.NET and SQL Server teams at Microsoft since July 2003.
標(biāo)簽: discussion planning thinking initial
上傳時(shí)間: 2014-01-08
上傳用戶:cjf0304
Using Gaussian elimination to solve linear equations. // In this version, we allow matrix of any size. This is done by treating // the name of a 2-dimensional array as pointer to the beginning of the // array. This makes use of the fact that arrays in C are stored in // row-major order.
標(biāo)簽: elimination equations Gaussian version
上傳時(shí)間: 2016-02-14
上傳用戶:hxy200501
分?jǐn)?shù)是兩個(gè)整數(shù)的比,通常表示為 (或b/a)的形式,其中b稱為分子,a稱為分母,分母不能為0。分?jǐn)?shù)在計(jì)算機(jī)中以整數(shù)或浮點(diǎn)數(shù)(有限小數(shù))的形式表示,大多數(shù)情況下都是近似表示,具有較大的誤差,例如 ,在計(jì)算機(jī)中用整數(shù)表示為0,用浮點(diǎn)數(shù)表示為0.333333。本實(shí)例就是要設(shè)計(jì)一個(gè)Fraction (分?jǐn)?shù)) 類類型,該類型的對(duì)象可以像基本類型數(shù)據(jù)一樣進(jìn)行運(yùn)算,結(jié)果仍為分?jǐn)?shù),運(yùn)算包括四則運(yùn)算,關(guān)系運(yùn)算,及求一元一次分式方程的解,輸入輸出要求按分?jǐn)?shù)方式進(jìn)行。
標(biāo)簽: 分?jǐn)?shù) 整數(shù)
上傳時(shí)間: 2016-02-18
上傳用戶:zhoujunzhen
This document represents the first stage in a process of taking the National Strategy for Police Information Systems (NSPIS) forward. It defines the mechanisms to ensure that we (and our partners) have access to the right information, in the right form, in the right time at an appropriate cost. The Strategy will ensure the Police Service has a collective understanding of the value of information and that we are able to exploit National Information Assets in support of local policing.
標(biāo)簽: represents the National Strategy
上傳時(shí)間: 2016-03-08
上傳用戶:wangdean1101
圖的深度遍歷,輸出結(jié)果為(紅色為鍵盤輸入的數(shù)據(jù),權(quán)值都置為1): 輸入頂點(diǎn)數(shù)和弧數(shù):8 9 輸入8個(gè)頂點(diǎn). 輸入頂點(diǎn)0:a 輸入頂點(diǎn)1:b 輸入頂點(diǎn)2:c 輸入頂點(diǎn)3:d 輸入頂點(diǎn)4:e 輸入頂點(diǎn)5:f 輸入頂點(diǎn)6:g 輸入頂點(diǎn)7:h 輸入9條弧. 輸入弧0:a b 1 輸入弧1:b d 1 輸入弧2:b e 1 輸入弧3:d h 1 輸入弧4:e h 1 輸入弧5:a c 1 輸入弧6:c f 1 輸入弧7:c g 1 輸入弧8:f g 1 深度優(yōu)先遍歷: a b d h e c f g 程序結(jié)束.
標(biāo)簽:
上傳時(shí)間: 2016-04-04
上傳用戶:lht618
編程題(15_01.c) 結(jié)構(gòu) struct student { long num char name[20] int score struct student *next } 鏈表練習(xí): (1).編寫函數(shù)struct student * creat(int n),創(chuàng)建一個(gè)按學(xué)號(hào)升序排列的新鏈表,每個(gè)鏈表中的結(jié)點(diǎn)中 的學(xué)號(hào)、成績由鍵盤輸入,一共n個(gè)節(jié)點(diǎn)。 (2).編寫函數(shù)void print(struct student *head),輸出鏈表,格式每行一個(gè)結(jié)點(diǎn),包括學(xué)號(hào),姓名,分?jǐn)?shù)。 (3).編寫函數(shù)struct student * merge(struct student *a,struct student *b), 將已知的a,b兩個(gè)鏈表 按學(xué)號(hào)升序合并,若學(xué)號(hào)相同則保留成績高的結(jié)點(diǎn)。 (4).編寫函數(shù)struct student * del(struct student *a,struct student *b),從a鏈表中刪除b鏈表中有 相同學(xué)號(hào)的那些結(jié)點(diǎn)。 (5).編寫main函數(shù),調(diào)用函數(shù)creat建立2個(gè)鏈表a,b,用print輸出倆個(gè)鏈表;調(diào)用函數(shù)merge升序合并2個(gè) 鏈表,并輸出結(jié)果;調(diào)用函數(shù)del實(shí)現(xiàn)a-b,并輸出結(jié)果。 a: 20304,xxxx,75, 20311,yyyy,89 20303,zzzz,62 20307,aaaa,87 20320,bbbb,79 b: 20302,dddd,65 20301,cccc,99 20311,yyyy,87 20323,kkkk,88 20307,aaaa,92 20322,pppp,83
標(biāo)簽: student struct score long
上傳時(shí)間: 2016-04-13
上傳用戶:zxc23456789
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1