數據結構(嚴慰敏)配套純c代碼實驗十 typedef int InfoType // 定義其它數據項的類型 typedef int KeyType // 定義RedType類型的關鍵字為整型 struct RedType // 記錄類型(同c10-1.h) { KeyType key // 關鍵字項 InfoType otherinfo // 其它數據項 } typedef char KeysType // 定義關鍵字類型為字符型 #include"c1.h" #include"c10-3.h" void InitList(SLList &L,RedType D[],int n) { // 初始化靜態鏈表L(把數組D中的數據存于L中) char c[MAX_NUM_OF_KEY],c1[MAX_NUM_OF_KEY] int i,j,max=D[0].key //
標簽: typedef int InfoType KeyType
上傳時間: 2016-03-03
上傳用戶:2404
輸入四個點,判斷此四點是否可形成一個平行四邊形。 程序中描述了一個抽象數據類型Vector2D,表示一個向量。具有(x,y)兩個值。其本身具有減另一個向量(minus(Vector2D)),判斷自身是否為零向量(iszero()),與另一個向量對應值y,x乘積之差(inner(Vector2D))。由于兩個向量平行,則乘積之差x1*y2-x2*y1=0。點A,B,C,D四點組成平行四邊形的條件是AB//CD,BC//DA且各個向量皆不為零向量。 首先聲明四個向量。向量i獲得值的方法是由getPoint(int i)獲得。然后根據Vector2D重載后的toString()函數將各個向量輸出查看。最后判斷此四點是否可組成平行四邊行。
標簽: 輸入
上傳時間: 2016-04-30
上傳用戶:qq521
CRC16算法的Java實現,使用方法如下: CRC16 crc16 = new CRC16() byte[] b = new byte[] { // (byte) 0xF0,(byte)0xF0,(byte)0xF0,(byte)0x72 (byte) 0x2C, (byte) 0x00, (byte) 0xFF, (byte) 0xFE, (byte) 0xFE, (byte) 0x04, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 } for (int k = 0 k < b.length k++) { crc16.update(b[k]) } System.out.println(Integer.toHexString(crc16.getValue())) System.out.println(Integer.toHexString(b.length))
上傳時間: 2014-12-20
上傳用戶:ve3344
%radon transform clear all % N=800 n=1:N fs=200 t=n/fs x1=exp(j*2*pi*(5*t+0.5*5*t.^2)) x2=exp(j*2*pi*(5*t+0.5*15*t.^2)) x=x1+x2 %N=length(x) % ambifunb(x ) %*****************************************RAT naf=ambifunb(x) htl(abs(naf)) % [wh,rho,theta]=htl(abs(naf)) colormap([0,0,0]) % xlabel( 極半徑 ) % ylabel( 角度 ) %**************************************%找出峰值點的坐標,計算初始頻率和調頻斜率(正確) %找出峰值點的坐標 b=max(max(wh)) [u,a]=find(wh>=0.8*b)
上傳時間: 2014-10-27
上傳用戶:Yukiseop
詞法分析器 對輸入一個函數,并對其分析main() { int a,b a = 10 b = a + 20 }
上傳時間: 2013-12-20
上傳用戶:hfmm633
The task of clustering Web sessions is to group Web sessions based on similarity and consists of maximizing the intra- group similarity while minimizing the inter-group similarity. The first and foremost question needed to be considered in clustering W b sessions is how to measure the similarity between Web sessions.However.there are many shortcomings in traditiona1 measurements.This paper introduces a new method for measuring similarities between Web pages that takes into account not only the URL but also the viewing time of the visited web page.Yhen we give a new method to measure the similarity of Web sessions using sequence alignment and the similarity of W eb page access in detail Experiments have proved that our method is valid and e幣cient.
標簽: sessions clustering similarity Web
上傳時間: 2014-01-11
上傳用戶:songrui
LCS,即最常公共子序列的的C語言解法。prepare_for_backdate(char,char,int,int)函數是為后面的回溯法求得最長公共子序列做準備,并可得到子序列長度。lcs(char,int,int)函數是輸出子序列的。并用到了第一個函數的結果。因為要得到最終的子序列,要知道那些地方是可輸出的位置,因此構造數組b[][],當為1時表明當前位置匹配,可輸出,為2時需要往上回溯,為3時需要往左回溯,直到找到下一個為1的位置。而c[][]數組是保存找子序列過程中匹配位數。
標簽: prepare_for_backdate char LCS C語言
上傳時間: 2014-01-11
上傳用戶:yuchunhai1990
Instead of finding the longest common subsequence, let us try to determine the length of the LCS. Then tracking back to find the LCS. Consider a1a2…am and b1b2…bn. Case 1: am=bn. The LCS must contain am, we have to find the LCS of a1a2…am-1 and b1b2…bn-1. Case 2: am≠bn. Wehave to find the LCS of a1a2…am-1 and b1b2…bn, and a1a2…am and b b b b1b2…bn-1 Let A = a1 a2 … am and B = b1 b2 … bn Let Li j denote the length of the longest i,g g common subsequence of a1 a2 … ai and b1 b2 … bj. Li,j = Li-1,j-1 + 1 if ai=bj max{ L L } a≠b i-1,j, i,j-1 if ai≠j L0,0 = L0,j = Li,0 = 0 for 1≤i≤m, 1≤j≤n.
標簽: the subsequence determine Instead
上傳時間: 2013-12-17
上傳用戶:evil
一道程序編譯順序的考題,涉及到函數調用的先后順序及運算符號的優先級等問題。下面我展開給你講。 C的程序編譯總是從main函數開始的,這道題的重點在“fun((int)fun(a+c,b),a-c)) ”語句。 系統首先要確定最外層 fun()函數的實參,第一個參數的確定需要遞歸調用fun()函數(不妨稱其為內層函數)。內層函數的兩個參數分別為x=a+b=2+8=10、y=b=5,執行函數體x+y=10+5=15,于是得外層函數的參數x=15。其另一個參數y=a-c=2-b=-6,再次執行函數體,得最終返回值x+y=15+(-6)=9。
標簽: 程序編譯
上傳時間: 2014-12-03
上傳用戶:徐孺
生成Trick文件工具 1.Open command line 2.input tricktest Usage: TrickTest -f -o -i -f source mpeg2 file to trick -o trick output directory -i output file id -m max coding error, default 0 -b max bitrate for trick generate, default 0 mean no limit -s trick buffer block size, must be n*188 -l log file, default c:\tricktest.log example: tricktest -f 黑鷹行動.mpg -o c:\temp -i A -m 1000 -b 3750000 soure file: 黑鷹行動.mpg output directory: c:\temp filename: 000000A,000000A.ff,000000A.fr,000000A.vvx max coding error: 1000 trick generation speed: 3750000 bps a
標簽: TrickTest tricktest command source
上傳時間: 2014-01-23
上傳用戶:水口鴻勝電器