1.[問題描述] 編寫遞歸算法,計算二叉樹中葉子結(jié)點的數(shù)目 [輸入] 按照先序序列的順序輸入該結(jié)點的內(nèi)容。其輸入abd eh cf i g . [輸出] 按中序序列輸出,輸出的結(jié)果為;dbheaficg并計算出二叉樹中葉子結(jié)點的數(shù)目為4 [存儲結(jié)構(gòu)] 采用二叉表存儲 [算法的基本思想] 采用遞歸方法建立和遍歷二叉樹。首先建立二叉樹的根結(jié)點,然后建立其左右子樹,直到空子樹為止,中序遍歷二叉樹時,先遍厲左子樹,后遍厲右子樹,最后訪問根結(jié)點。根據(jù)左右子樹的最后一個結(jié)點計算出二叉樹中葉子結(jié)點的數(shù)目。 程序如下: #include<stdio.h> #include<malloc.h> #include"stdlib.h"
上傳時間: 2015-11-16
上傳用戶:GavinNeko
VC 中音樂最完美的實現(xiàn) 想在程序中播放mp3,wma,wav等所有格式的音樂文件嗎?網(wǎng)上這樣的介紹真是少!!這是一個封裝了音樂的各種操作,比如音量調(diào)節(jié),進(jìn)度調(diào)節(jié),的類。包 含兩個類,CMusic,CSound。分別在文件music.h,music.cpp,sound.h,sound.cpp。
上傳時間: 2014-08-12
上傳用戶:xiaohuanhuan
完成一個FIR數(shù)字濾波器的設(shè)計。要求: 1、 基于直接型和分布式兩種算法。 2、 輸入數(shù)據(jù)寬度為8位,輸出數(shù)據(jù)寬度為16位。 3、 濾波器的階數(shù)為16階,抽頭系數(shù)分別為h[0]=h[15]=0000,h[1]=h[14]=0065,h[2]=h[13]=018F,h[3]=h[12]=035A,h[4]=h[11]=0579,h[5]=h[10]=078E,h[6]=h[9]=0935,h[7]=h[8]=0A1F。
標(biāo)簽: FIR 8位 數(shù)字濾波器 分布式
上傳時間: 2013-11-28
上傳用戶:duoshen1989
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
標(biāo)簽: represented integers group items
上傳時間: 2016-01-17
上傳用戶:jeffery
數(shù)據(jù)結(jié)構(gòu)(嚴(yán)慰敏)配套純c代碼實驗十 typedef int InfoType // 定義其它數(shù)據(jù)項的類型 typedef int KeyType // 定義RedType類型的關(guān)鍵字為整型 struct RedType // 記錄類型(同c10-1.h) { KeyType key // 關(guān)鍵字項 InfoType otherinfo // 其它數(shù)據(jù)項 } typedef char KeysType // 定義關(guān)鍵字類型為字符型 #include"c1.h" #include"c10-3.h" void InitList(SLList &L,RedType D[],int n) { // 初始化靜態(tài)鏈表L(把數(shù)組D中的數(shù)據(jù)存于L中) char c[MAX_NUM_OF_KEY],c1[MAX_NUM_OF_KEY] int i,j,max=D[0].key //
標(biāo)簽: typedef int InfoType KeyType
上傳時間: 2016-03-03
上傳用戶:2404
rt12864m樣例程序,管腳號 管腳名稱 電平 管腳功能描述 1 VSS 0V 電源地 2 VCC +5V 電源正 3 V0 - 對比度(亮度)調(diào)整 4 RS(CS) H/L RS="H",表示DB7--DB0為顯示數(shù)據(jù) 4 RS(CS) H/L RS="L",表示DB7--DB0為顯示指令數(shù)據(jù) 5 R/W(SID) H/L R/W="H",E="H",數(shù)據(jù)被讀到DB7--DB0 5 R/W(SID) H/L R/W="L",E="H→L", DB7--DB0的數(shù)據(jù)被寫到IR或DR 6 E(SCLK) H/L 使能信號 7 DB0 H/L 三態(tài)數(shù)據(jù)線 8 DB1 H/L 三態(tài)數(shù)據(jù)線 9 DB2 H/L 三態(tài)數(shù)據(jù)線 10 DB3 H/L 三態(tài)數(shù)據(jù)線 11 DB4 H/L 三態(tài)數(shù)據(jù)線 12 DB5 H/L 三態(tài)數(shù)據(jù)線 13 DB6 H/L 三態(tài)數(shù)據(jù)線 14 DB7 H/L 三態(tài)數(shù)據(jù)線 15 PSB H/L H:8位或4位并口方式,L:串口方式(見注釋1) 16 NC - 空腳 17 /RESET H/L 復(fù)位端,低電平有效(見注釋2) 18 VOUT - LCD驅(qū)動電壓輸出端 19 A VDD 背光源正端(+5V)(見注釋3) 20 K VSS 背光源負(fù)端(見注釋3)
上傳時間: 2016-04-17
上傳用戶:xhz1993
非常適合內(nèi)嵌式mp3播放,例如控制臺!注意看壓縮包里readme.doc 詳細(xì)過程,在ARM及MIPS下通過 新建一個 wce application,選擇 a simple windows ce application 在 1.tool->options->directories>include files里包含必要的頭文件 D:\WINCE500\pubilc\directx\SDK\INC D:\WINCE500\pubilc\common\SDK\INC D:\WINCE500\pubilc\common\OAK\INC D:\WINCE500\pubilc\common\DDK\INC 2. >Library files D:\WINCE500\PUBLIC\DIRECTX\SDK\LIB\MIPSII\RETAIL D:\WINCE500\PUBLIC\COMMON\SDK\LIB\MIPSII\RETAIL D:\WINCE500\PUBLIC\COMMON\OAK\LIB\MIPSII\RETAIL 3.可能要在Project->Settings->link的object/library modules 加入 commctrl.lib coredll.lib ole32.lib oleaut32.lib uuid.lib strmiids.lib newres.h play.cpp play.vcw resource.h StdAfx.cpp StdAfx.h 下面為播放源碼 #include "stdafx.h" #include<dshow.h> #include<streams.h> .......其實編譯時的 object/library modules 只要看 sourse 文件包含哪個dll,或lib 就行
標(biāo)簽: application windows readme simple
上傳時間: 2016-05-05
上傳用戶:ynsnjs
由三星的2442修改而來,正確引導(dǎo)eboot,請注意用三星公版的硬件配置,具體可以參考QQ2440,因為我在些平臺上跑過,具體操作 1.target settings : post-linker:選擇為 ARM fromELF 2.ARM assembler與 ARM c Compiler 的 architecture or processor 選擇為:ARM920T 3.ARM linker的 output:RO base為 0x00000000 (當(dāng)仿真時為:0x30000000),layout的 object/sysmbol:為2440init.o section:Init 4.ARM fromELF 的 output:format:plain binary , output file name:nboot.bin 下面為全部源碼,注意用ADS編譯 2442addr.h 2442addr.inc 2442init.s 2442lib.c 2442lib.h 2442loader-1208.c 2442slib.h 2442slib.s Def.h k9s1208_s.s Memcfg.inc Nand.h Nand_mini.c Option.h Option.inc
標(biāo)簽: post-linker settings target eboot
上傳時間: 2016-05-06
上傳用戶:moshushi0009
wince 自帶的DB數(shù)據(jù)庫編譯,由CEDBUse修改下,主要是修改了編譯通不過,通過后操作不正常,還有驗證在MIPS和ARM分別完成數(shù)據(jù)庫操作(增加,刪除,修改) 一開始本人以為自帶的數(shù)據(jù)庫只支持四列,原來不是指這個意思而是指4種索引!所以在本源碼里已經(jīng)在表里加入了五列數(shù)據(jù)! 主要包含文件: CEDBUseDlg.cpp CEDBUseDlg.h StudentInputDlg.cpp StudentInputDlg.h CEDBUse.cpp CEDBUse.h 注意與原版不同的 //memset(pProps,0,LocalSize(pProps)) 最被注釋掉 因為第二次分配內(nèi)存時會導(dǎo)致本程序出錯,注釋掉不影響操作
標(biāo)簽: CEDBUse wince MIPS 修改
上傳時間: 2014-01-08
上傳用戶:liuchee
Digital Signature Algorithm (DSA)是Schnorr和ElGamal簽名算法的變種,被美國NIST作為DSS(DigitalSignature Standard)。算法中應(yīng)用了下述參數(shù): p:L bits長的素數(shù)。L是64的倍數(shù),范圍是512到1024; q:p - 1的160bits的素因子; g:g = h^((p-1)/q) mod p,h滿足h < p - 1, h^((p-1)/q) mod p > 1; x:x < q,x為私鑰 ; y:y = g^x mod p ,( p, q, g, y )為公鑰; H( x ):One-Way Hash函數(shù)。DSS中選用SHA( Secure Hash Algorithm )。 p, q, g可由一組用戶共享,但在實際應(yīng)用中,使用公共模數(shù)可能會帶來一定的威脅。簽名及驗證協(xié)議如下: 1. P產(chǎn)生隨機(jī)數(shù)k,k < q; 2. P計算 r = ( g^k mod p ) mod q s = ( k^(-1) (H(m) + xr)) mod q 簽名結(jié)果是( m, r, s )。 3. 驗證時計算 w = s^(-1)mod q u1 = ( H( m ) * w ) mod q u2 = ( r * w ) mod q v = (( g^u1 * y^u2 ) mod p ) mod q 若v = r,則認(rèn)為簽名有效。 DSA是基于整數(shù)有限域離散對數(shù)難題的,其安全性與RSA相比差不多。DSA的一個重要特點是兩個素數(shù)公開,這樣,當(dāng)使用別人的p和q時,即使不知道私鑰,你也能確認(rèn)它們是否是隨機(jī)產(chǎn)生的,還是作了手腳。RSA算法卻作不到。
標(biāo)簽: Algorithm Signature Digital Schnorr
上傳時間: 2014-01-01
上傳用戶:qq521
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1