ADT BinaryTree 的實(shí)現(xiàn)及驗(yàn)證程序采用的主要數(shù)據(jù)結(jié)構(gòu):二叉樹、棧、隊(duì)算法思想:1、 先序建樹、輸出樹、后序遍歷用遞歸方法。性能分析:O( n )2、 先序遍歷、中序遍歷:性能分析:O( n )(1) 若遇到新節(jié)點(diǎn)非空則先入棧,然后訪問其左子樹。(2) 若為空則將棧頂結(jié)點(diǎn)出棧,訪問其右子樹。(3) 循環(huán)1、2直到棧為空且無節(jié)點(diǎn)可入棧。先序與中序的區(qū)別是:先序在入棧時(shí)訪問節(jié)點(diǎn),中序在出棧時(shí)訪問節(jié)點(diǎn)。3、 層遍歷:性能分析:O( n )(1) 根節(jié)點(diǎn)入隊(duì)(2) 節(jié)點(diǎn)出隊(duì)并訪問(3) 若節(jié)點(diǎn)有左孩子,則左孩子入隊(duì);有右孩子,則右孩子入隊(duì)。(4) 重復(fù)2、3直到隊(duì)列為空。4、 線索樹:算法與先序遍歷、中序遍歷一樣,只是將訪問節(jié)點(diǎn)的Visit函數(shù)改為連接前驅(qū)與后繼的操作。性能分析:O(
標(biāo)簽: BinaryTree ADT 性能分析 樹
上傳時(shí)間: 2014-12-20
上傳用戶:SimonQQ
數(shù)字運(yùn)算,判斷一個(gè)數(shù)是否接近素?cái)?shù) A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上傳時(shí)間: 2015-05-21
上傳用戶:daguda
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
標(biāo)簽: government streamline important alphabet
上傳時(shí)間: 2015-06-09
上傳用戶:weixiao99
目錄 摘要 ABSTRACT 前言 第一章 為什么要開發(fā)一個(gè)學(xué)生檔案管理系統(tǒng)? 第二章 計(jì)算機(jī)已經(jīng)成為我們學(xué)習(xí)和工作的得力助手 1.1 在中小學(xué)中用計(jì)算機(jī)管理學(xué)生檔案的意義 1.2 為將來學(xué)校上網(wǎng)做好準(zhǔn)備 1.4 學(xué)生檔案的設(shè)計(jì)分析 第三章 怎樣開發(fā)一個(gè)學(xué)生檔案管理系統(tǒng)? 2.1 編程環(huán)境的選擇 2.2 關(guān)系型數(shù)據(jù)庫的實(shí)現(xiàn) 2.3 二者的結(jié)合(DBA) 第四章 Windows下的Visual Basic 編程環(huán)境簡介 3.1 告別“hello world”的年代
標(biāo)簽: ABSTRACT 計(jì)算機(jī) 目錄 管理系統(tǒng)
上傳時(shí)間: 2014-01-17
上傳用戶:wfeel
上下文無關(guān)文法(Context-Free Grammar, CFG)是一個(gè)4元組G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一組有限的產(chǎn)生式規(guī)則集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素稱為非終結(jié)符,T的元素稱為終結(jié)符,S是一個(gè)特殊的非終結(jié)符,稱為文法開始符。 設(shè)G=(V, T, S, P)是一個(gè)CFG,則G產(chǎn)生的語言是所有可由G產(chǎn)生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個(gè)語言L是上下文無關(guān)語言(Context-Free Language, CFL),當(dāng)且僅當(dāng)存在一個(gè)CFG G,使得L=L(G)。 *⇒ 例如,設(shè)文法G:S→AB A→aA|a B→bB|b 則L(G)={a^nb^m | n,m>=1} 其中非終結(jié)符都是大寫字母,開始符都是S,終結(jié)符都是小寫字母。
標(biāo)簽: Context-Free Grammar CFG
上傳時(shí)間: 2013-12-10
上傳用戶:gaojiao1999
palm編成,這種書很少,有興趣看看 Title: Palm Programming: The Developer s Guide URL: http://safari.oreilly.com/JVXSL.asp?x=1&mode=section&sortKey=rank&sortOrder=desc&view=book&xmlid=1-56592-525-4&open=false&srchText=palm+programming&code=&h=&m=&l=1&catid=&s=1&b=1&f=1&t=1&c=1&u=1&page=0 ISBN: 1-56592-525-4 Author: Julie McKeehan/ Neil Rhodes Publisher: O Reilly Page: 478 Edition: 1st edition (December 1998) Catalog: PDA programming / Palm Format: pdf Size: 2.06M Supplier: Summary: Emerging as the bestselling hand-held computers of all time, PalmPilots have spawned intense developer activity and a fanatical following. Used by Palm in their developer training, this tutorial-style book shows intermediate to experienced C programmers how to build a Palm application from the ground up. Includes a CD-ROM with source code and third-party developer tools
標(biāo)簽: Programming Developer oreilly safari
上傳時(shí)間: 2013-12-10
上傳用戶:litianchu
基于C/S模式的考試系統(tǒng)的研究與開發(fā) 1 1. 前言 1 1.1 MICROSOFT VISUAL STUDIO .NET 2003開發(fā)平臺(tái)和C#語言的特點(diǎn) 1 1.2用C/S模式開發(fā)計(jì)算機(jī)考試系統(tǒng)的優(yōu)越性 1 2. 系統(tǒng)分析 2 2.1系統(tǒng)基本情況描述 2 2.2 可行性分析 2 2.3 需求分析 3 2.3.1采用SA方法畫出計(jì)算機(jī)考試系統(tǒng)的一套分層數(shù)據(jù)流圖 3 2.3.2數(shù)據(jù)詞典 4 3. 系統(tǒng)設(shè)計(jì) 4 3.1系統(tǒng)配置 4 3.2系統(tǒng)概要設(shè)計(jì) 4 3.2.1系統(tǒng)結(jié)構(gòu)圖 4 3.2.2模塊功能及界面設(shè)計(jì) 4 3.2.3模塊界面設(shè)計(jì) 5 3.3系統(tǒng)詳細(xì)設(shè)計(jì) 6 3.3.1模塊詳細(xì)設(shè)計(jì) 6
標(biāo)簽: MICROSOFT VISUAL STUDIO 2003
上傳時(shí)間: 2013-12-26
上傳用戶:dragonhaixm
delphi7企業(yè)人力資源管理系統(tǒng) 目 錄 1、緒論 4 1.1 選題背景 4 1.2 本系統(tǒng)所采用的技術(shù) 5 2、系統(tǒng)分析 6 2.1 系統(tǒng)框架及功能模塊 6 2.2 系統(tǒng)流程 7 2.3 系統(tǒng)的功能模塊分析 8 2.3.1機(jī)構(gòu)編制管理 8 2.3.2職員信息管理模塊 9 2.3.3薪資福利管理模塊 10 3、系統(tǒng)設(shè)計(jì) 12 3.1 系統(tǒng)的數(shù)據(jù)庫設(shè)計(jì) 12 3.1.1組織機(jī)構(gòu)編碼表 12 3.1.2職員基本信息表 12 3.1.3個(gè)人所得稅表 13 3.1.4職員獎(jiǎng)勵(lì)表 13 3.1.5月工資統(tǒng)計(jì)表 14 3.2 系統(tǒng)界面設(shè)計(jì) 15 3.2.1程序運(yùn)行界面展示 15 3.2.2界面具體設(shè)計(jì) 16 結(jié)束語 17 參考文獻(xiàn) 18
上傳時(shí)間: 2014-01-27
上傳用戶:zsjinju
設(shè)給定n 個(gè)變量1 x , 2 x ,…, n x 。將這些變量依序作底和各層冪,可得n重冪如下 n x x x x 3 2 1 這里將上述n 重冪看作是不確定的,當(dāng)在其中加入適當(dāng)?shù)睦ㄌ?hào)后,才能成為一個(gè)確定的 n 重冪。不同的加括號(hào)方式導(dǎo)致不同的n 重冪。例如,當(dāng)n=4 時(shí),全部4重冪有5個(gè)。
標(biāo)簽: 變量
上傳時(shí)間: 2015-10-28
上傳用戶:1101055045
給定n個(gè)整數(shù)a , a , ,an 1 2 組成的序列。序列中元素i a 的符號(hào)定義為: ï î ï í ì - < = > = 1 0 0 0 1 0 sgn( ) i i i i a a a a 符號(hào)平衡問題要求給定序列的最長符號(hào)平衡段的長度L,即: þ ý ü î í ì = + - = å = £ £ £ max 1| sgn( ) 0 1 j k i i j n k L j i a 。 例如,當(dāng)n=10,相應(yīng)序列為:1,1,-1,-2,0,1,3,-1,2,-1 時(shí),L=9。
上傳時(shí)間: 2015-10-28
上傳用戶:xaijhqx
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1