Implemented BFS, DFS and A* To compile this project, use the following command: g++ -o search main.cpp Then you can run it: ./search The input is loaded from a input file in.txt Here is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm. Then there is an integer h indicate the number of heuristic. The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.
標(biāo)簽: Implemented following compile command
上傳時(shí)間: 2014-01-01
上傳用戶:lhc9102
上下文無(wú)關(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é)符,稱為文法開(kāi)始符。 設(shè)G=(V, T, S, P)是一個(gè)CFG,則G產(chǎn)生的語(yǔ)言是所有可由G產(chǎn)生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個(gè)語(yǔ)言L是上下文無(wú)關(guān)語(yǔ)言(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é)符都是大寫(xiě)字母,開(kāi)始符都是S,終結(jié)符都是小寫(xiě)字母。
標(biāo)簽: Context-Free Grammar CFG
上傳時(shí)間: 2013-12-10
上傳用戶:gaojiao1999
一:需求分析 1. 問(wèn)題描述 魔王總是使用自己的一種非常精練而抽象的語(yǔ)言講話,沒(méi)人能聽(tīng)懂,但他的語(yǔ)言是可逐步解釋成人能聽(tīng)懂的語(yǔ)言,因?yàn)樗恼Z(yǔ)言是由以下兩種形式的規(guī)則由人的語(yǔ)言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫(xiě)一個(gè)魔王語(yǔ)言的解釋系統(tǒng),把 他的話解釋成人能聽(tīng)得懂的話. 2. 基本要求: 用下述兩條具體規(guī)則和上述規(guī)則形式(2)實(shí)現(xiàn).設(shè)大寫(xiě)字母表示魔王語(yǔ)言的詞匯 小寫(xiě)字母表示人的語(yǔ)言的詞匯 希臘字母表示可以用大寫(xiě)字母或小寫(xiě)字母代換的變量.魔王語(yǔ)言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測(cè)試數(shù)據(jù): B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫(xiě)字母與漢字建立下表所示的對(duì)應(yīng)關(guān)系,則魔王說(shuō)的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時(shí)間: 2014-12-02
上傳用戶:jkhjkh1982
LCDScreen is a couple of Delphi component which simulate a dot-LCD multilines screen. It is fully customizable and has animation and special effects capabilities for the displayed text. TLCDScreen is the display component and TLCDAnimator the animation one. Both have build-in Property editor making easier the development at design-time.
標(biāo)簽: multilines LCDScreen component simulate
上傳時(shí)間: 2015-12-23
上傳用戶:invtnewer
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
標(biāo)簽: converts Toolbox complex logical
上傳時(shí)間: 2016-02-12
上傳用戶:a673761058
免費(fèi)的Office控件,可以應(yīng)用于B/S和C/S程序,實(shí)現(xiàn)完美內(nèi)嵌office
上傳時(shí)間: 2013-12-28
上傳用戶:gtzj
【實(shí)驗(yàn)名稱】遞歸子程序分析器的設(shè)計(jì)與實(shí)現(xiàn) 【實(shí)驗(yàn)?zāi)康暮鸵蟆? 設(shè)計(jì)、編制,調(diào)試一個(gè)典型的語(yǔ)法分析程序,實(shí)現(xiàn)對(duì)如下的遞歸子程序語(yǔ)法的分析,進(jìn)一步掌握常用的語(yǔ)法分析方法。 【實(shí)驗(yàn)內(nèi)容】 ① 本分析程序所分析的文法如下: G[E]: E->eBaA A->a|bAcB B->dEd|aC C->e|dC ② 針對(duì)上述文法編寫(xiě)一遞歸子程序分析程序,該程序的輸入是任意符號(hào)串,輸出是本次輸入的符號(hào)串是否是該文法的句子的結(jié)論。 【環(huán)境】 Windows Pc 機(jī),任何版本的c語(yǔ)言 其中還包括java語(yǔ)言實(shí)現(xiàn)的程序
標(biāo)簽: 實(shí)驗(yàn) 分析器 遞歸 程序
上傳時(shí)間: 2013-12-25
上傳用戶:lanhuaying
Libvirt是一套在linux上用C編寫(xiě)的虛擬化操作工具接口。其目的是提供一個(gè)穩(wěn)定的支持Xen,QEME和KVM虛擬化平臺(tái)的C(也支持Python) API Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes).The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms, it currently also support QEmu and KVM.
標(biāo)簽: Libvirt linux Xen 編寫(xiě)
上傳時(shí)間: 2016-05-02
上傳用戶:Altman
回溯算法解決n皇后問(wèn)題,c++源碼,可以參考
標(biāo)簽: 回溯算法
上傳時(shí)間: 2016-05-04
上傳用戶:牛津鞋
This book is for the experience and not the same level of the design process so prepared by the staff, of course, the reader should at least be able to prepare a simple C language program. On the C language are learning readers, this book is any C language tutorial excellent supporting materials, to be able to answer all relevant questions.
標(biāo)簽: the experience prepared process
上傳時(shí)間: 2013-12-20
上傳用戶:jcljkh
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1