有限元素求和 給定具有n個(gè)不同元素的整數(shù)集合A和另一個(gè)整數(shù)值M,問(wèn),可否從A中取最多k次元素(所取元素可以相同),使得所取的元素和為M。 例如,從n=3個(gè)元素的集合A={1, 4, 6}中取最多 k=3次,使 M=13 。可以取 1+6+6=13,若m=6,則可以直接取6 或者 1+1+4。 若可以,則輸出 yes,否則,輸出no.
上傳時(shí)間: 2017-02-28
上傳用戶(hù):3到15
算法思路: 1.如果只有一個(gè)金片,則把該金片從源移動(dòng)到目標(biāo)棒,結(jié)束。 2.如果有n個(gè)金片,則把前n-1個(gè)金片移動(dòng)到輔助的棒,然后把自己移動(dòng)到目標(biāo)棒,最后再把前n-1個(gè)移動(dòng)到目標(biāo)棒. 3.單純對(duì)于有N個(gè)金片要挪動(dòng)的步數(shù)求出, 可以使用遞推方法,滿(mǎn)足遞推方程f(i) = f(i - 1) * 2 + 1
標(biāo)簽: 算法
上傳時(shí)間: 2017-03-04
上傳用戶(hù):leehom61
【問(wèn)題描述】 設(shè)計(jì)一個(gè)利用哈夫曼算法的編碼和譯碼系統(tǒng),重復(fù)地顯示并處理以下項(xiàng)目,直到選擇退出為止。 【基本要求】 (1)初始化:鍵盤(pán)輸入字符集大小n、n個(gè)字符和n個(gè)權(quán)值,建立哈夫曼樹(shù); (2)編碼:利用建好的哈夫曼樹(shù)生成哈夫曼編碼; (3)輸出編碼; (4)設(shè)字符集及頻度如下表: 字符:A B C D E F 頻度:4 9 23 2 17 15 字符:G H I J K 頻度:1 2 3 3 4
上傳時(shí)間: 2017-03-07
上傳用戶(hù):qwe1234
單片機(jī)I@C程序庫(kù),很容易移槙,我已用過(guò)N多次,很好用
上傳時(shí)間: 2013-12-18
上傳用戶(hù):xiaoxiang
Measuring Frequency Content in Signals I this section we will study some non parametric methods for spectrum estimation of a stochastic process. These methods are described in the literature. All methods are based on the Periodogram which is defined for a sequence x[n] with length N according to
標(biāo)簽: parametric Measuring Frequency Content
上傳時(shí)間: 2017-03-20
上傳用戶(hù):秦莞爾w
UART library for x51, can be used with any c cross compiler and can be used for X51 uC. I had used keil.
標(biāo)簽: used for can compiler
上傳時(shí)間: 2014-01-23
上傳用戶(hù):yiwen213
進(jìn)程間通信14 說(shuō)明了進(jìn)程控制原語(yǔ)并且觀察了如何調(diào)用多個(gè)進(jìn)程。但是這些進(jìn)程之間交換信息的 唯一方法是經(jīng)由f o r k或e x e c傳送打開(kāi)文件,或通過(guò)文件系統(tǒng)。本章將說(shuō)明進(jìn)程之間相互通信的 其他技術(shù)—I P C(InterProcess Communication)。
標(biāo)簽: 進(jìn)程 進(jìn)程間通信 控制 傳送
上傳時(shí)間: 2013-12-03
上傳用戶(hù):zhenyushaw
I was trying to develope a programme to make a slide show of all the pictures of a folder using vb.net. I have spent lot of time in net for searching this but all in vain, I didn t get a simple programme to solve the same and lastly I gave myself a try for the same and developed the code, I have used there a folderbrowserdialogue and a timer with a picture box control and in coding I have used IO name spaces to get the pathe and folder info here is the code. Enjoy Subhankar
標(biāo)簽: programme develope pictures trying
上傳時(shí)間: 2017-04-24
上傳用戶(hù):a3318966
課程設(shè)計(jì): 1.求出在一個(gè)n×n的棋盤(pán)上,放置n個(gè)不能互相捕捉的國(guó)際象棋“皇后”的所有布局。 2.設(shè)計(jì)一個(gè)利用哈夫曼算法的編碼和譯碼系統(tǒng),重復(fù)地顯示并處理以下項(xiàng)目,直到選擇退出為止。 【基本要求】 1) 將權(quán)值數(shù)據(jù)存放在數(shù)據(jù)文件(文件名為data.txt,位于執(zhí)行程序的當(dāng)前目錄中) 2) 分別采用動(dòng)態(tài)和靜態(tài)存儲(chǔ)結(jié)構(gòu) 3) 初始化:鍵盤(pán)輸入字符集大小n、n個(gè)字符和n個(gè)權(quán)值,建立哈夫曼樹(shù); 4) 編碼:利用建好的哈夫曼樹(shù)生成哈夫曼編碼; 5) 輸出編碼; 6) 設(shè)字符集及頻度如下表: 字符 空格 A B C D E F G H I J K L M 頻度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 字符 N O P Q R S T U V W X Y Z 頻度 57 63 15 1 48 51 80 23 8 18 1 16 1
標(biāo)簽:
上傳時(shí)間: 2017-04-24
上傳用戶(hù):zhyiroy
簡(jiǎn)單的i/O接口的vhdl設(shè)計(jì),包括工程,源碼,仿真波形,為POC型的接口
上傳時(shí)間: 2014-01-20
上傳用戶(hù):talenthn
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1