大整數(shù)乘法例子代碼 /* 遞歸邊界,如果是1位二進(jìn)制數(shù)與1位二進(jìn)制數(shù)相乘,則可以直接計(jì)算 */ /*累計(jì)做1位二進(jìn)制乘法運(yùn)算的次數(shù)*/ /* return (X*Y) */ /* 計(jì)算n的值 */ /* 把X和Y拆分開來,令X=A*2^(n/2)+B, 左移位運(yùn)算,mod = 1<<(n/2) */ /* 計(jì)算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 計(jì)算A*C,再向左移n位 */ /* 遞歸計(jì)算A*D */ /* 遞歸計(jì)算C*B */ /* 計(jì)算a21+a22,再向左移n/2位 */ /* 遞歸計(jì)算B*D */ /* XY=a1+a2+a3 */
上傳時(shí)間: 2015-05-19
上傳用戶:gyq
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á)上千萬的
【問題描述】已知線性方程組AX=B,求解該方程組。參考算法: 消去法:將列向量B加到矩陣A的最后一列,構(gòu)成增廣矩陣AB。對(duì)AB進(jìn)行下列三種初等變換,使原矩陣A的部分的主對(duì)角線上的元素均為1,其余元素均為0,則原列向量B的部分即為X的值: 1. 將矩陣的一行乘以一個(gè)不為0的數(shù) 2. 將矩陣的一行加上另一行的倍數(shù) 3. 交換矩陣中兩行的位置
上傳時(shí)間: 2015-06-18
上傳用戶:stvnash
Design Specification Introduction Goals and Objectives GameForge is a graphical tool used to aid in the design and creation of video games. It attempts to bring game development down to a level that any computer savvy user can understand, without requiring masterful programming ability. A user with limited Microsoft DirectX and/or Visual C++ programming knowledge will be able to construct a basic, 2-D arcade game. GameForge limits the amount of actual code written by the user, if not eliminating it completely. It will also assist experienced programmers in generating the Microsoft DirectX and Microsoft Windows9x overhead necessary for basic game construction, allowing them to concentrate on more detailed game design issues and implementation.
標(biāo)簽: Specification Introduction Objectives GameForge
上傳時(shí)間: 2013-12-27
上傳用戶:wl9454
該源碼是一個(gè)問題的解決方法。問題是給你個(gè)長為L的串,串中可以出現(xiàn)n種字符,還給出m個(gè)子串,求有多少個(gè)長為n的只由這些字串組成的串。輸入例子:4 5 6 ABB BCA BCD CAB CDD DDA 結(jié)果為2.而5 4 5 E D C B A的結(jié)果為625
標(biāo)簽: 源碼
上傳時(shí)間: 2014-01-12
上傳用戶:水中浮云
/*** *** *** *** *** *** *** *** *** *** *** *** **/ //**此映射表用來映射LED模塊不譯碼時(shí),顯示的字符和必須輸入的數(shù)據(jù)的關(guān)系 //**每段和對(duì)應(yīng)比特位的關(guān)系見示意圖 // g // --- --- // b | a |f | | <---顯示0時(shí)點(diǎn)亮的段為gfedcb // --- // c | |e | | 那么寫入數(shù)據(jù)為0x7e // --- --- // d // bit: 7 6 5 4 3 2 1 0 // 段位: g f e d c b a
上傳時(shí)間: 2013-11-25
上傳用戶:
假定已經(jīng)有許多應(yīng)用采用了程序1 - 1 5中所定義的C u r r e n c y類,現(xiàn)在我們想要對(duì)C u r r e n c y類 的描述進(jìn)行修改,使其應(yīng)用頻率最高的兩個(gè)函數(shù)A d d和I n c r e m e n t可以運(yùn)行得更快,從而提高應(yīng) 用程序的執(zhí)行速度。由于用戶僅能通過p u b l i c部分所提供的接口與C u r r e n c y類進(jìn)行交互,
上傳時(shí)間: 2015-10-11
上傳用戶:BIBI
acm HDOJ 1051WoodenSticks Description: There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are associated with cleaning operations and changing tools and shapes in the machine. The setup times of the woodworking machine are given as follows: (a) The setup time for the first wooden stick is 1 minute. (b) Right after processing a stick of length l and weight w , the machine will need no setup time for a stick of length l and weight w if l<=l and w<=w . Otherwise, it will need 1 minute for setup.
標(biāo)簽: WoodenSticks Description length wooden
上傳時(shí)間: 2014-03-08
上傳用戶:netwolf
LCD-7279的經(jīng)過調(diào)試多次已經(jīng)能夠?qū)崿F(xiàn)在指定的位置顯示特定的數(shù)據(jù)。 程序lcd1.c實(shí)現(xiàn)基本的功能,即:鍵盤輸入0、1、2、3、4、5、6、7、8、9、a\b\c\d\e\f 在液晶的指定位置顯示實(shí)現(xiàn)滿屏或半屏顯示點(diǎn)陣和字符,調(diào)入一幅圖畫的代碼進(jìn)行顯示;
標(biāo)簽: 7279 LCD lcd 調(diào)試
上傳時(shí)間: 2014-01-14
上傳用戶:hgy9473
CFlowchartEditor is an extension of CDiagramEditor. CDiagramEditor is a vector editor, with a CWnd-derived window (CDiagramEditor), a data container (CDiagramEntityContainer) holding the draw-objects, undo stack and managing copy and paste, and objects derived from CDiagramEntity representing objects drawn on screen. CDiagramEditor lacks one feature (that is difficult to implement in both simple and general fashion) - links. Manually maintaining links in a - for example - flowchart or network topography map is unwieldy. Therefore, I ve created a reference implementation for one way of adding this functionality.
標(biāo)簽: CDiagramEditor CFlowchartEditor extension CWnd-d
上傳時(shí)間: 2015-11-21
上傳用戶:氣溫達(dá)上千萬的
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1