上下文無關文法(Context-Free Grammar, CFG)是一個4元組G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一組有限的產生式規則集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素稱為非終結符,T的元素稱為終結符,S是一個特殊的非終結符,稱為文法開始符。 設G=(V, T, S, P)是一個CFG,則G產生的語言是所有可由G產生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個語言L是上下文無關語言(Context-Free Language, CFL),當且僅當存在一個CFG G,使得L=L(G)。 *⇒ 例如,設文法G:S→AB A→aA|a B→bB|b 則L(G)={a^nb^m | n,m>=1} 其中非終結符都是大寫字母,開始符都是S,終結符都是小寫字母。
標簽: Context-Free Grammar CFG
上傳時間: 2013-12-10
上傳用戶:gaojiao1999
第一章涵蓋了內建的數據型別,語言預先定義好的運算符、標準程序庫中那個的vector和string類、條件語句和循環語句、輸入和輸出用的iostream庫。第二章解釋函數的設計和使用;第三章涵蓋所謂的Standard Template Library;第四章講述classes機制的設計和使用過程。第五章說明如何擴展classes;第六章的重頭戲是class templates 第七章講述如何使用c++提供的異常處理機制。
標簽: 數據
上傳時間: 2014-02-20
上傳用戶:zyt
This book is the most accurate and up-to-date source of information the STL currently available. ... It has an approach and appeal of its own: it explains techniques for building data structures and algorithms on top of the STL, and in this way appreciates the STL for what it is - a framework. Angelika Langer, Independent Consultant and C++ Report Columnist "A superbly authored treatment of the STL......an excellent book which belongs in any serious C++ developer s library." Jim Armstrong, President 2112 F/X, Texas. \n The C++ Standard Template Library (STL) represents a breakthrough in C++ programming techniques. With it, software developers can achieve vast improvements in the reliability of their software, and increase their own productivity.
標簽: information up-to-date available currently
上傳時間: 2015-10-31
上傳用戶:CHINA526
本書由知名的C++專家Matthew H.Austern執筆,引導你進入泛型編程思維模型,并將你帶往此一模型的最重要成品:C++ Standard Template Library(STL)。本書揭示STL的奧秘,告訴你STL不僅僅是一組方便運用的容器類(container classes)。對于泛型組件和可交互作用的組件而言,STL是一個具備擴充能力的框架(framework)、 《泛型編程與STL》闡述了泛型編程的中心思想:concepts、modeling、refinement,并為你展示這些思想如何導出STL的基礎概念:iterators、containers、function objects。循此路線,你可以把STL想像為一個由concepts(而非明確之functions或classes)組成的程序庫:、你將學習其正式結構并因此獲得其潛在威力所帶來的完整優勢。本書使你能夠: ●以你自己的“可移植組件”及“可交互作用之泛型組件”擴充STL; ●產生一些算法,讓它們和它們所處理之型別(types)及數據結構徹底劃清界線; ●撰寫更精致、更高效、更有效力的代碼,可跨平臺重復使用。
上傳時間: 2014-01-06
上傳用戶:Avoid98
一:需求分析 1. 問題描述 魔王總是使用自己的一種非常精練而抽象的語言講話,沒人能聽懂,但他的語言是可逐步解釋成人能聽懂的語言,因為他的語言是由以下兩種形式的規則由人的語言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫一個魔王語言的解釋系統,把 他的話解釋成人能聽得懂的話. 2. 基本要求: 用下述兩條具體規則和上述規則形式(2)實現.設大寫字母表示魔王語言的詞匯 小寫字母表示人的語言的詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測試數據: B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫字母與漢字建立下表所示的對應關系,則魔王說的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時間: 2014-12-02
上傳用戶:jkhjkh1982
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.
標簽: represented integers group items
上傳時間: 2016-01-17
上傳用戶:jeffery
《C++標準程序庫》本書不僅對每一個程序庫組件提供范圍廣泛的說明,也對繁復的觀念提供清楚明亮的解釋,并描述高效運用這些組件時需要的實際編程細節,提出一個又一個的范例程序。本書是一本包含最新資料的完整書籍。反映出被ANSI/ISO C++語言標準規格書納入C++標準程序庫的最新組成。更明確地說,本書將焦點放在標準模板庫(Standard Template Library)身上,檢驗其中的容器(containers)
上傳時間: 2016-02-27
上傳用戶:qiaoyue
JavaServer Pages, Third Edition is completely revised and updated to cover the substantial changes in the 2.0 version of the JSP specification. It also includes detailed coverage of the major revisions to the JSP Standard Tag Library (JSTL) specification. Combining plenty of practical advice with detailed coverage of JSP syntax and features and clear, useful examples, JavaServer Pages, Third Edition demonstrates how to embed server-side Java into Web pages, while also covering important topics such as JavaBeans, Enterprise JavaBeans (EJB), and JDBC database access.
標簽: substantial JavaServer completely Edition
上傳時間: 2014-01-04
上傳用戶:mpquest
CppReference 對于c/c++的詳盡說明 C/C++ Reference General C/C++ Pre-processor commands Operator Precedence Escape Sequences ASCII Chart Data Types Keywords Standard C Library Standard C I/O Standard C String & Character Standard C Math Standard C Time & Date Standard C Memory Other standard C functions All C Functions C++ C++ I/O C++ Strings C++ String Streams Miscellaneous C++ C++ Standard Template Library C++ Algorithms C++ Vectors C++ Double-Ended Queues C++ Lists C++ Priority Queues C++ Queues C++ Stacks C++ Sets C++ Multisets C++ Maps C++ Multimaps C++ Bitsets Iterators All C++ Functions
標簽: Pre-processor CppReference Reference Operator
上傳時間: 2016-10-26
上傳用戶:aeiouetla
C++ 標準程序庫提供一組通用類別(classes)和接口(interfaces),可大幅擴充 C++ 核心語言。由于程序庫本身并不容易,為了完整運用其組件并從其強大的威力中獲得幫助,你需要一份完善的資源,而非一份僅僅陳列類和函數的普通文檔。《The C++ Standard Library》不僅對每一個程序庫組件提供范圍廣泛的說明,也對繁雜的感念提供清楚明亮的解釋,并描述高效運用這些組件時需要的實際編程細節,提出一個又一個的范例程序。這本包含最新資料的完整書籍,反映出被 ANSI/ISO C++ 語言標準規格書納入的 C++ 標準程序庫的結構。更明確地說,本書將焦點放在標準模板庫(Standard Template Library)身上,檢驗其中的容器(containers)、迭代器(iterators)、仿函數(functors)和算法(algorithms)。你還可以找到特殊容器、字符串(strings)、數值類別、國際化議題、IOStream。每一個組件都有深刻的呈現,包括其介紹、設計、運用實例、細部解說、陷阱、意想不到的危險,以及相關類別和函數的確切標記(signature)和定義。一份見解深刻的基礎概念介紹和一個程序庫綜合鳥瞰,會對新手帶來快速的提升。
標簽: interfaces classes 標準 接口
上傳時間: 2017-02-10
上傳用戶:天涯