Strings

Size: px
Start display at page:

Download "Strings"

Transcription

1 Linked Data Structures Cheng-Chin Chiang

2 Introduction 鏈式資料結構 : 一種容器資料型態, 元素以節點 (Node) 形式儲存, 前後元素之間藉由單向或雙向指標互相連結 範例 串列 (Linked List) 樹 (Tree)

3 Nodes 每個節點可以宣告為一個 structure 或 class 記憶體靠動態配置產生 須包含指到其他節點的 pointers (links) struct ListNode { string item; int count; ListNode *link; }; typedef ListNode* ListNodePtr; ListNodePtr head; // 宣告一個串列的起點 ListNode

4 Accessing a Node 透過指標則使用 ->, 透過 dereference (*) 則用. (*head).count = 12; // 把 head 所指 node 中的 count 欄位設為 12 head->count = 12; // 同上 cin >> head->item; // 鍵盤輸入 head 所指 node 中的 item 欄位值

5 End Markers 一個鏈式資料結構必須有終點 將最後一個節點的指標欄位設為 NULL

6 Linked List 串列包含二個重要元素 第一個節點 ( 頭,head) 我們一定會在程式中儲存一個指標指向它 最後一個節點 ( 尾, tail 或 end) 此節點的指標欄位必為 NULL

7 Linked List Class Definition class IntNode { public: IntNode() { } IntNode(int thedata, IntNOde* thelink) : data(thedata), link(thelink) { } IntNode* getlink() const {return link;} int getdata() const {return data;} void setdata(int thedata) {data = thedata;} void setlink(intnode* pointer) private: int data; IntNode *link; }; typedef IntNode* IntNodePtr; {link=pointer;}

8 Create 1 st Node IntNodePtr head; 宣告一個節點指標, 預備使其指到串列頭 head = new IntNode; 動態配置第一個節點記憶體, 將 head 指到此節點 head->setdata(3); 設定節點資料值為 3 head->setlink(null); 此時因此節點為串列頭, 亦為串列尾, 所以將其指標欄位設為 NULL!

9 Adding a Node at the Head

10 Lost Nodes Pitfall

11 Inserting in the Middle of a Linked List (1 of 2)

12 Inserting in the Middle of a Linked List (2 of 2)

13 Removing a Node

14 Searching a Linked List Function with two arguments: IntNodePtr search(intnodeptr head, int target); //Precondition: pointer head points to head of //linked list. Pointer in last node is NULL. //If list is empty, head is NULL //Returns pointer to 1 st node containing target //If not found, returns NULL

15 Pseudocode for search Function while (here doesn t point to target node or last node) { Make here point to next node in list } if (here node points to target) return here; else return NULL; while (here->getdata()!= target && here->getlink()!= NULL) here = here->getlink(); if (here->getdata() == target) return here; else return NULL;

16 Doubly Linked Lists Doubly Linked List 每個節點有二個指標, 一個指向前元素, 另一個指向後繼元素 可以雙向跟尋 利用 NULL 標示二頭端點

17 Doubly Linked Lists class DoublyLinkedIntNode { public: DoublyLinkedIntNode ( ){} DoublyLinkedIntNode (int thedata, DoublyLinkedIntNode* previous, DoublyLinkedIntNode* next) : data(thedata), nextlink(next), previouslink(previous) {} DoublyLinkedIntNode* getnextlink( ) const { return nextlink; } DoublyLinkedIntNode* getpreviouslink( ) const { return previouslink; } int getdata( ) const { return data; } void setdata(int thedata) { data = thedata; } void setnextlink(doublylinkedintnode* pointer) { nextlink = pointer; } void setpreviouslink(doublylinkedintnode* pointer) { previouslink = pointer; } private: int data; DoublyLinkedIntNode *nextlink; DoublyLinkedIntNode *previouslink; }; typedef DoublyLinkedIntNode* DoublyLinkedIntNodePtr;

18 Adding a Node to the Front of a Doubly Linked List (1 of 2)

19 Adding a Node to the Front of a Doubly Linked List (2 of 2)

20 Deleting a Node from a Doubly Linked List (1 of 2)

21 Deleting a Node from a Doubly Linked List (2 of 2)

22 Stacks 堆疊 先進後出 (FILO) 或是 後進先出 (LIFO) 應用 追蹤 C++/C 中的函數呼叫 區域變數記憶體管理 模擬 可以利用串列來模擬堆疊

23 A Stack Graphic

24 Interface File for a Stack Template Class (1 of 2)

25 Interface File for a Stack Template Class (2 of 2)

26 Program Using the Stack Template Class (1 of 2)

27 Program Using the Stack Template Class (2 of 2)

28 Stack Push and Pop 新增資料到堆疊 push Recall: goes to "top" of stack 自堆疊移除資料 pop Recall: removed from "top" of stack Exercise by yourselves!

29 Queues 佇列 資料先進先出 (FIFO) 應用 尾進頭出 排隊買票 模擬 可以利用串列來模擬佇列

30 Interface File for a Queue Template Class (1 of 3)

31 Interface File for a Queue Template Class (2 of 3)

32 Interface File for a Queue Template Class (3 of 3)

33 Program Using the Queue Template Class

34 Hash Tables 雜湊 ( 赫序 ) 表 可以快速儲存與取出資料的對應表 ( 或映射 ) 我們將以單向串列來模擬 使用雜湊函數 將資料對應到索引 (Key) 在此以 string integer 為例

35 Simple Hash Function for Strings 函數輸出定義 : 將字串內所有字元的 ASCII 碼總和除以一數的餘數 此函數可以自行依照需要設計與定義 int computehash(string s) { int hash = 0; for (int i = 0; i < s.length( ); i++) { hash = hash + s[i]; } return hash % SIZE; // SIZE = 10 in example } Example: dog = ASCII 100, 111, 103 Hash = ( ) % 10 = 4

36 Hash Table Operations 存入 (Store) 準備十個串列 加入一字串資料時, 先算出此字串之雜湊函數輸出值, 假設為 N 將新資料節點加入第 N 個串列中 取出 (Retrieve) 以輸入字串為索引, 計算雜湊函數輸出值, 假設為 N 從第 N 個串列中搜尋出此字串所在之節點

37 Constructing a Hash Table

38 Interface File for a HashTable Class (1 of 2) 1 // This is the header file hashtable.h. This is the interface 2 // for the class HashTable, which is a class for a hash table 3 // of strings. 4 #ifndef HASHTABLE_H 5 #define HASHTABLE_H 6 #include <string> 7 #include "listtools.h" The library "listtools.h" is the linked list library interface from Display using LinkedListSavitch::Node; 9 using std::string; 10 namespace HashTableSavitch 11 { 12 const int SIZE = 10; // Maximum size of the hash table array

39 Interface File for a HashTable Class (2 of 2) 13 class HashTable 14 { 15 public: 16 HashTable(); // Initialize empty hash table 17 // Normally a copy constructor and overloaded assignment 18 // operator would be included. They have been omitted 19 // to save space. 20 virtual ~HashTable(); // Destructor destroys hash table 21 bool containsstring(string target) const; 22 // Returns true if target is in the hash table, 23 // false otherwise 24 void put(string s); 25 // Adds a new string to the hash table 26 private: 27 Node<string> *hasharray[size]; // The actual hash table 28 static int computehash(string s); // Compute a hash value 29 }; // HashTable 30 } // HashTableSavitch 31 #endif // HASHTABLE_H

40 Implementation File for Hash Table Class (1 of 3) 1 // This is the implementation file hashtable.cpp. 2 // This is the implementation of the class HashTable. 3 #include <string> 4 #include "listtools.h" 5 #include "hashtable.h" 6 using LinkedListSavitch::Node; 7 using LinkedListSavitch::search; 8 using LinkedListSavitch::headInsert; 9 using std::string; 10 namespace HashTableSavitch 11 { 12 HashTable::HashTable() 13 { 14 for (int i = 0; i < SIZE; i++) 15 { 16 hasharray[i] = NULL; 17 } 18}

41 Implementation File for Hash Table Class (2 of 3) 19 HashTable::~HashTable() 20 { 21 for (int i=0; i<size; i++) 22 { 23 Node<string> *next = hasharray[i]; 24 while (next!= NULL) 25 { 26 Node<string> *discard = next; 27 next = next->getlink( ); 28 delete discard; 29 } 30 } 31 } 32 int HashTable::computeHash(string s) 33 { 34 int hash = 0; 35 for (int i = 0; i < s.length( ); i++) 36 { 37 hash = hash + s[i]; 38 } 39 return hash % SIZE; 40 }

42 Implementation File for Hash Table Class (3 of 3) 41 void HashTable::put(string s) 42 { 43 int hash = computehash(s); 44 if (search(hasharray[hash], s)==null) 45 { 46 // Only add the target if it's not in the list 47 headinsert(hasharray[hash], s); 48 } 49 } 50 } // HashTableSavitch

43 Hash Table Demonstration 1 // Program to demonstrate use of the HashTable class 2 #include <string> 3 #include <iostream> 4 #include "hashtable.h" 5 #include "listtools.cpp" 6 #include "hashtable.cpp" 7 using std::string; 8 using std::cout; 9 using std::endl; 10 using HashTableSavitch::HashTable; SAMPLE DIALOGUE Adding dog, cat, turtle, bird Contains dog? 1 Contains cat? 1 Contains turtle? 1 Contains bird? 1 Contains fish? 0 Contains cow? 0 11 int main() 12 { 13 HashTable h; 14 cout << "Adding dog, cat, turtle, bird" << endl; 15 h.put("dog"); 16 h.put("cat"); 17 h.put("turtle"); 18 h.put("bird"); 19 cout << "Contains dog? " << h.containsstring("dog") << endl; 20 cout << "Contains cat? " << h.containsstring("cat") << endl; 21 cout << "Contains turtle? " << h.containsstring("turtle") << endl; 22 cout << "Contains bird? " << h.containsstring("bird") << endl; 23 cout << "Contains fish? " << h.containsstring("fish") << endl; 24 cout << "Contains cow? " << h.containsstring("cow") << endl; 25 return 0; } Copyright 2008 Pearson Addison-Wesley. All rights reserved.

44 Hash Table Efficiency 最差狀況 (Worst Case) 全部資料都有相同的雜湊輸出值, 導致搜尋時要搜尋全部的節點才能找到資料 ( 或確定不存在 ) 最佳狀況 (Best Case) 每個料都有不同的雜湊輸出值, 如此只要搜尋僅包含一個節點即可找到資料 ( 或確定不存在 ) 好的雜湊表必須有好的雜湊函數 抉擇取捨 : 須靠大空間來換取低的雜湊碰撞 (Collision) 率

45 Set Template Class 集合包含多個不重複的元素 集合基本運算 Add Contains Union Intersection

46 Interface File for a Set Template Class (1 of 2) 1 // This is the header file set.h. This is the interface 2 // for the class Set, which is a class for a generic set. 3 #ifndef SET_H 4 #define SET_H 5 #include "listtools.h" "listtools.h" is the linked list library interface from Display using LinkedListSavitch::Node; 7 namespace SetSavitch 8 { 9 template<class T> 10 class Set 11 { 12 public: 13 Set() { head = NULL; } // Initialize empty set 14 // Normally a copy constructor and overloaded assignment 15 // operator would be included. They have been omitted 16 // to save space. 17 virtual ~Set(); // Destructor destroys set

47 Interface File for a Set Template Class (2 of 2) 18 bool contains(t target) const; 19 // Returns true if target is in the set, false otherwise 20 void add(t item); 21 // Adds a new element to the set 22 void output(); 23 // Outputs the set to the console 24 Set<T>* setunion(const Set<T>& otherset); 25 // Union calling object's set with otherset 26 // and return a pointer to the new set 27 Set<T>* setintersection(const Set<T>& otherset); 28 // Intersect calling object's set with otherset 29 // and return a pointer to the new set 30 private: 31 Node<T> *head; 32 }; // Set 33 } // SetSavitch 34 #endif // SET_H

48 Implementation File for a Set Template Class (1 of 4) 1 // This is the implementation file set.cpp. 2 // This is the implementation of the class Set. 3 #include <iostream> 4 #include "listtools.h" 5 #include "set.h" 6 using std::cout; 7 using std::endl; 8 using LinkedListSavitch::Node; 9 using LinkedListSavitch::search; 10 using LinkedListSavitch::headInsert; 11 namespace SetSavitch 12 { 13 template<class T> 14 Set<T>::~Set() 15 { 16 Node<T> *todelete = head; 17 while (head!= NULL) 18 { 19 head = head->getlink( ); 20 delete todelete; 21 todelete = head; 22 } 23 }

49 Implementation File for a Set Template Class (2 of 4) 24 template<class T> 25 bool Set<T>::contains(T target) const 26 { 27 Node<T>* result = search(head, target); 28 if (result == NULL) 29 return false; 30 else 31 return true; 32 } 33 void Set<T>::output() 34 { 35 Node<T> *iterator = head; 36 while (iterator!= NULL) 37 { 38 cout << iterator->getdata( ) << " "; 39 iterator = iterator->getlink( ); 40 } 41 cout << endl; 42 }

50 Implementation File for a Set Template Class (3 of 4) 43 template<class T> 44 void Set<T>::add(T item) 45 { 46 if (search(head, item) ==NULL) 47 { 48 // Only add the target if it's not in the list 49 headinsert(head, item); 50 } 51 } 52 template<class T> 53 Set<T>* Set<T>::setUnion(const Set<T>& otherset) 54 { 55 Set<T> *unionset = new Set<T>(); 56 Node<T>* iterator = head; 57 while (iterator!= NULL) 58 { 59 unionset->add(iterator- >getdata( )); 60 iterator = iterator->getlink( ); 61 } 62 iterator = otherset.head; 63 while (iterator!= NULL) 64 { 65 unionset->add(iterator- >getdata( )); 66 iterator = iterator->getlink( ); 67 } 68 return unionset; 69 }

51 Implementation File for a Set Template Class (4 of 4) 70 template<class T> 71 Set<T>* Set<T>::setIntersection(const Set<T>& otherset) 72 { 73 Set<T> *interset = new Set<T>(); 74 Node<T>* iterator = head; 75 while (iterator!= NULL) 76 { 77 if (otherset.contains(iterator->getdata( ))) 78 { 79 interset->add(iterator->getdata( )); 80 } 81 iterator = iterator->getlink( ); 82 } 83 return interset; 84 } 85 } // SetSavitch

52 Set Demonstration (1 of 3) 1 // Program to demonstrate use of the Set class 2 #include <iostream> 3 #include <string> 4 #include "set.h" 5 #include "listtools.cpp" 6 #include "set.cpp" 7 using std::cout; 8 using std::endl; 9 using std::string; 10 using namespace SetSavitch; 11 int main() 12 { 13 Set<string> round; // Round things 14 Set<string> green; // Green things 15 round.add("peas"); // Sample data for both sets 16 round.add("ball"); 17 round.add("pie"); 18 round.add("grapes"); 19 green.add("peas"); 20 green.add("grapes"); 21 green.add("garden hose"); 22 green.add("grass");

53 Set Demonstration (2 of 3) 23 cout << "Contents of set round: "; 24 round.output(); 25 cout << "Contents of set green: "; 26 green.output(); 27 cout << "ball in set round? " << 28 round.contains("ball") << endl; 29 cout << "ball in set green? " << 30 green.contains("ball") << endl; 31 cout << "ball and peas in same set? "; 32 if ((round.contains("ball") && round.contains("peas")) 33 (green.contains("ball") && green.contains("peas"))) 34 cout << " true" << endl; 35 else 36 cout << " false" << endl; 37 cout << "pie and grass in same set? "; 38 if ((round.contains("pie") && round.contains("grass")) 39 (green.contains("pie") && green.contains("grass"))) 40 cout << " true" << endl; 41 else 42 cout << " false" << endl;

54 Set Demonstration (3 of 3) 43 cout << "Union of green and round: " << endl; 44 Set<string> *unionset = round.setunion(green); 45 unionset->output(); 46 delete unionset; 47 cout << "Intersection of green and round: " << endl; 48 Set<string> *interset = round.setintersection(green); 49 interset->output(); 50 delete interset; 51 return 0; 52 } SAMPLE DIALOGUE Contents of set round: grapes pie ball peas Contents of set green: grass garden hose grapes peas ball in set round? 1 ball in set green? 0 ball and peas in same set? true pie and grass in same set? false Union of green and round: garden hose grass peas ball pie grapes Intersection of green and round: peas grapes

55 Iterators 迭代器 用來在鏈式結構中依序逐一拜訪節點元素的機制

56 Pointers as Iterators 我們可以利用指標來模擬迭代器 指標迭代器 : 範例 : Node_Type *iterator; for (iterator = Head; iterator!= NULL; iterator=iterator->link) Do_Action

57 Iterator Classes 我們也可自定一個比指標迭代器更多功能的迭代器類別 此迭代器類別可有下列運算子 : ++ 迭代器移到下一個節點 -- 迭代器移到上一個節點 == 比較迭代器是否相等!= 比較迭代器是否不相等 * 取得迭代器所指的節點 也可有下列成員函數 : begin(): 傳回第一個節點 end(): 傳回最後一個節點

58 Iterator Class Example 逐一拜訪並處理每個節點 : for (i=ds.begin();i!=ds.end();i++) process *i //*i is current data item i: variable name of iterator class

59 Trees 樹的資料結構較複雜 樹的每個資料節點可有多個指標指到其他節點 二元樹範例

60 Tree Structure: A Binary Tree (2 of 2)

61 Tree Properties 根節點 樹的頭 路徑 (Paths) 從根節點到其他任一節點的串列不能出現循環 二元樹 (Binary Trees) 除了葉結點外, 每個節點都有二個連結指到其他二個節點最常用到的樹 葉節點 二個連結指標都是 NULL( 不指到其他節點 )

62 Trees and Recursion 樹是一種遞迴結構 每棵二元樹都有二棵 子樹, 每個子樹又有二棵子樹, 依此類推 用在樹上的許多演算法都可用遞迴方式來設計 例如 : 樹中的資料搜尋

63 Binary Tree Processing Orders Preorder Processing: 1. 處理根節點資料 2. 處理左子樹 3. 處理右子樹 In-order Processing: 1. 處理左子樹 2. 處理根節點資料 3. 處理右子樹 Postorder Processing: 1. 處理左子樹 2. 處理右子樹 3. 處理根節點資料

64 Binary Search Tree (BST) Storage 通常依照特定順序儲存 1. 左子樹所有節點值小於根節點值 2. 右子樹所有節點值大於根節點值 3. 此規則適用於左子樹和又子樹中的節點和子樹 節點拜訪順序 Inorder values "in order Preorder "prefix" notation Postorder "postfix" notation

Strings

Strings Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

Microsoft PowerPoint - string_kruse [兼容模式]

Microsoft PowerPoint - string_kruse [兼容模式] Strings Strings in C not encapsulated Every C-string has type char *. Hence, a C-string references an address in memory, the first of a contiguous set of bytes that store the characters making up the string.

More information

c_cpp

c_cpp C C++ C C++ C++ (object oriented) C C++.cpp C C++ C C++ : for (int i=0;i

More information

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf("%d", &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf("%

2013 C 1 #include <stdio.h> 2 int main(void) 3 { 4 int cases, i; 5 long long a, b; 6 scanf(%d, &cases); 7 for (i = 0; i < cases; i++) 8 { 9 scanf(% 2013 ( 28 ) ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 10 B 1 C 1 D 5 E 5 F 1 G II 5 H 30 1 2013 C 1 #include 2 int main(void) 3

More information

ebook39-5

ebook39-5 5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o

More information

運算子多載 Operator Overloading

運算子多載 Operator Overloading 多型 Polymorphism 講師 : 洪安 1 多型 編譯時期多型 ( 靜態多型 ) function overloading 如何正確呼叫同名的函數? 利用參數個數與型態 operator overloading 其實同 function overloading 執行時期多型 ( 或動態多型 ) 如何正確呼叫不同物件的相同名稱的成員函數 利用繼承與多型 2 子類別與父類別物件間的指定 (assignment)

More information

ebook39-6

ebook39-6 6 first-in-first-out, FIFO L i n e a r L i s t 3-1 C h a i n 3-8 5. 5. 3 F I F O L I F O 5. 5. 6 5. 5. 6.1 [ ] q u e n e ( r e a r ) ( f r o n t 6-1a A 6-1b 6-1b D C D 6-1c a) b) c) 6-1 F I F O L I F ADT

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

Open topic Bellman-Ford算法与负环

Open topic   Bellman-Ford算法与负环 Open topic Bellman-Ford 2018 11 5 171860508@smail.nju.edu.cn 1/15 Contents 1. G s BF 2. BF 3. BF 2/15 BF G Bellman-Ford false 3/15 BF G Bellman-Ford false G c = v 0, v 1,..., v k (v 0 = v k ) k w(v i 1,

More information

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

More information

Microsoft Word - 物件導向編程精要.doc

Microsoft Word - 物件導向編程精要.doc Essential Object-Oriented Programming Josh Ko 2007.03.11 object-oriented programming C++ Java OO class object OOP Ruby duck typing complexity abstraction paradigm objects objects model object-oriented

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

Microsoft PowerPoint - Model Checking a Lazy Concurrent List-Based Set Algorithm.ppt [Compatibility Mode]

Microsoft PowerPoint - Model Checking a Lazy Concurrent List-Based Set Algorithm.ppt [Compatibility Mode] Model Checking a Lazy Concurrent List-Based Set Algorithm ZHANG Shaojie, LIU Yang National University of Singapore Agenda Introduction Background Ourapproach Overview Linearizabilitydefinition Modelinglanguage

More information

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9

C 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf (%d, & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9 201 201 21 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 1 B 1 C 5 D RPG 10 E 10 F 1 G II 1 1 201 201 C 1 # include 2 int main ( void

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

Strings

Strings Polymorphism and Virtual Functions Cheng-Chin Chiang Virtual Function Basics 多 型 (Polymorphism) 賦 予 一 個 函 數 多 種 意 涵, 存 在 於 同 一 類 別 之 內 祖 先 類 別 與 後 代 類 別 間 物 件 導 向 程 式 設 計 基 本 原 理 虛 擬 函 數 (Virtual Function)

More information

2/80 2

2/80 2 2/80 2 3/80 3 DSP2400 is a high performance Digital Signal Processor (DSP) designed and developed by author s laboratory. It is designed for multimedia and wireless application. To develop application

More information

運算子多載 Operator Overloading

運算子多載 Operator Overloading 函數樣板 (Function Template) 與 類別樣板 (Class Template) 講師 : 洪安 1 資料結構與 C++ 程式設計進階班 為何需要通用函數? (1/2) int abs(int x) { return (x>0)?x:-x; 取名困難不好記 float fabs(float x) { return (x>0)?x:-x; complex cabs(complex x)

More information

提问袁小兵:

提问袁小兵: C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,

More information

untitled

untitled 1 7 7.1 7.2 7.3 7.4 7.5 2 7.1 VFT virtual 7.1 3 1 1. 2. public protected public 3. VFT 4. this const volatile 4 2 5. ( ) ( ) 7.1 6. no-static virtual 7.2 7. inline 7.3 5 3 8. this this 9. ( ) ( ) delete

More information

科学计算的语言-FORTRAN95

科学计算的语言-FORTRAN95 科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造

More information

全国计算机技术与软件专业技术资格(水平)考试

全国计算机技术与软件专业技术资格(水平)考试 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明

More information

Simulator By SunLingxi 2003

Simulator By SunLingxi 2003 Simulator By SunLingxi sunlingxi@sina.com 2003 windows 2000 Tornado ping ping 1. Tornado Full Simulator...3 2....3 3. ping...6 4. Tornado Simulator BSP...6 5. VxWorks simpc...7 6. simulator...7 7. simulator

More information

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986

More information

Agenda 大 纲 FIFO data-structures 先 进 先 出 ( FIFO) 数 据 结 构 (= First In First Out) Heap data-structures 堆 结 构 Non-static methods 非 静 态 方 法 (= object metho

Agenda 大 纲 FIFO data-structures 先 进 先 出 ( FIFO) 数 据 结 构 (= First In First Out) Heap data-structures 堆 结 构 Non-static methods 非 静 态 方 法 (= object metho Java 编 程 与 算 法 实 用 入 门 A Concise and Practical Introduction to Programming Algorithms in Java Chapter 8: Data-structures and object methods 第 8 章 : 数 据 结 构 和 对 象 的 方 法 1 Agenda 大 纲 FIFO data-structures

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

提纲 1 2 OS Examples for 3

提纲 1 2 OS Examples for 3 第 4 章 Threads2( 线程 2) 中国科学技术大学计算机学院 October 28, 2009 提纲 1 2 OS Examples for 3 Outline 1 2 OS Examples for 3 Windows XP Threads I An Windows XP application runs as a seperate process, and each process may

More information

Factory Methods

Factory Methods Factory Methods 工 厂 方 法 eryar@163.com 摘 要 Abstract: 本 文 主 要 是 对 API Design for C++ 中 Factory Methods 章 节 的 翻 译, 若 有 不 当 之 处, 欢 迎 指 正 关 键 字 Key Words:C++ Factory Pattern 一 概 述 Overview 工 厂 方 法 是 创 建 型 模

More information

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2

BOOL EnumWindows(WNDENUMPROC lparam); lpenumfunc, LPARAM (Native Interface) PowerBuilder PowerBuilder PBNI 2 PowerBuilder 9 PowerBuilder Native Interface(PBNI) PowerBuilder 9 PowerBuilder C++ Java PowerBuilder 9 PBNI PowerBuilder Java C++ PowerBuilder NVO / PowerBuilder C/C++ PowerBuilder 9.0 PowerBuilder Native

More information

Microsoft Word - ch04三校.doc

Microsoft Word - ch04三校.doc 4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear

More information

Microsoft Word - Learn Objective-C.doc

Microsoft Word - Learn Objective-C.doc Learn Objective C http://cocoadevcentral.com/d/learn_objectivec/ Objective C Objective C Mac C Objective CC C Scott Stevenson [object method]; [object methodwithinput:input]; output = [object methodwithoutput];

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: feis.tw@gmail.com 9 [P.11] : Dev C++ [P.12] : http://c.feis.tw [P.13] [P.14] [P.15] [P.17] [P.23] Dev C++ [P.24] [P.27] [P.34] C / C++ [P.35] 10 C / C++ C C++ C C++ C++ C ( ) C++

More information

第3章.doc

第3章.doc 3 3 3 3.1 3 IT Trend C++ Java SAP Advantech ERPCRM C++ C++ Synopsys C++ NEC C C++PHP C++Java C++Java VIA C++ 3COM C++ SPSS C++ Sybase C++LinuxUNIX Motorola C++ IBM C++Java Oracle Java HP C++ C++ Yahoo

More information

資料結構之C語言重點複習

資料結構之C語言重點複習 鏈結串列自編教材 ( 一 ) 本教材 ( 一 ) 目標問題 : 每次以亂數產生一 [0,1000] 之整數值, 若該值 >100, 則以同方式繼續產生下一亂數值, 若該值

More information

W. Richard Stevens UNIX Sockets API echo Sockets TCP OOB IO C struct C/C++ UNIX fork() select(2)/poll(2)/epoll(4) IO IO CPU 100% libevent UNIX CPU IO

W. Richard Stevens UNIX Sockets API echo Sockets TCP OOB IO C struct C/C++ UNIX fork() select(2)/poll(2)/epoll(4) IO IO CPU 100% libevent UNIX CPU IO Linux muduo C++ (giantchen@gmail.com) 2012-09-30 C++ TCP C++ x86-64 Linux TCP one loop per thread Linux native muduo C++ IT 5 C++ muduo 2 C++ C++ Primer 4 W. Richard Stevens UNIX Sockets API echo Sockets

More information

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 範 例 試 題 (C++) 試 題 編 號 :11900-920201-4 審 定 日 期 : 94 年 7 月 1 日 修 訂 日 期 : 96 年 2 月 1 日 97 年 1 月 30 日 ( 第 二 部 份 ) 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 應 檢 參 考 資 料 壹 試

More information

Microsoft Word - 11.doc

Microsoft Word - 11.doc 除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何

More information

陣列與鏈結串列 Array and Linked List

陣列與鏈結串列 Array and Linked List 陣列與鏈結串列 Array and Linked List 講師 : 洪安 1 大綱 結構陣列 鏈結串列 單向鏈結串列之資料型態 單向鏈結串列之基本運算 課堂練習 2 結構陣列 優點 缺點 使用容易 class student int math; int english; int computer; ; 刪除與插入造成資料移動頻繁 浪費不必要之記憶體 int main() student s[5];

More information

C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1

C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1 C++ 程序设计 OJ9 - 参考答案 MASTER 2019 年 6 月 7 日 1 1 CARDGAME 1 CardGame 题目描述 桌上有一叠牌, 从第一张牌 ( 即位于顶面的牌 ) 开始从上往下依次编号为 1~n 当至少还剩两张牌时进行以下操作 : 把第一张牌扔掉, 然后把新的第一张放到整叠牌的最后 请模拟这个过程, 依次输出每次扔掉的牌以及最后剩下的牌的编号 输入 输入正整数 n(n

More information

PowerPoint Presentation

PowerPoint Presentation 陣列與鏈結串列 NTU CSIE Outline 結構陣列鏈結串列 單向鏈結串列之資料型態 單向鏈結串列之基本運算 作業 結構陣列 優點 缺點 使用容易 刪除與插入造成資料移動頻繁浪費不必要之記憶體陣列長度為常數, 可能會不夠用 #include struct _student int math; int english; int computer; ; typedef struct

More information

Microsoft PowerPoint - L17_Inheritance_v4.pptx

Microsoft PowerPoint - L17_Inheritance_v4.pptx C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING 前言 - Andrew Payne 目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX 目录 4 RESOURCES 致谢

More information

untitled

untitled 3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(

More information

ebook50-11

ebook50-11 11 Wi n d o w s C A D 53 M F C 54 55 56 57 58 M F C 11.1 53 11-1 11-1 MFC M F C C D C Wi n d o w s Wi n d o w s 4 11 199 1. 1) W M _ PA I N T p W n d C W n d C D C * p D C = p W n d GetDC( ); 2) p W n

More information

演算法導入、ソート、データ構造、ハッシュ

演算法導入、ソート、データ構造、ハッシュ 培訓 - 1 演算法導入 ソート データ構造 ハッシュ 演算法導入 ソート データ構造 ハッシュ momohuang c2251393 chiangyo September 23, 2013 1 Schedule of the Year 1.1 Major Competition 9 12 11 10 12 10 TOI 的最 3 TOI 3 TOI 100 20 4 TOI 30 12 5 TOI

More information

Chapter12 Derived Classes

Chapter12   Derived Classes 继 承 -- 派 生 类 复 习 1. 有 下 面 类 的 说 明, 有 错 误 的 语 句 是 : class X { A) const int a; B) X(); C) X(int val) {a=2 D) ~X(); 答 案 :C 不 正 确, 应 改 成 X(int val) : a(2) { 2. 下 列 静 态 数 据 成 员 的 特 性 中, 错 误 的 是 A) 说 明 静 态 数

More information

Microsoft PowerPoint - 11_Templates.ppt

Microsoft PowerPoint - 11_Templates.ppt 1 1. 上機考 20% 期末考 6/23( 四 ) 晚 6:30~8:30 範圍 : 第 7, 8, 9, 10 章實習內容 按座位坐, 隨機抽兩題 2. 紙上測驗 20% 6/21( 二 ) :9:30~11:00 課本 7-11, 13 章內容 2 第 11 章樣版 (Templates) 11.1 簡介 11.2 函式樣版 11.3 多載函式樣版 11.4 類別樣版 11.5 類別樣版與無型

More information

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074> 程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学

More information

Microsoft Word - 981192001.htm

Microsoft Word - 981192001.htm 098 年 度 11901 電 腦 軟 體 設 計 (JAVA) 乙 級 技 術 士 技 能 檢 定 學 科 測 試 試 題 本 試 卷 有 選 擇 題 80 題, 每 題 1.25 分, 皆 為 單 選 選 擇 題, 測 試 時 間 為 100 分 鐘, 請 在 答 案 卡 上 作 答, 答 錯 不 倒 扣 ; 未 作 答 者, 不 予 計 分 准 考 證 號 碼 : 姓 名 : 單 選 題 :

More information

Microsoft Word - 970617cppFinalSolution.doc

Microsoft Word - 970617cppFinalSolution.doc 國 立 台 灣 海 洋 大 學 資 訊 工 程 系 C++ 程 式 設 計 期 末 考 參 考 答 案 姓 名 : 系 級 : 學 號 : 97/06/17 考 試 時 間 :10:00 12:10 試 題 敘 述 蠻 多 的, 看 清 楚 題 目 問 什 麼, 針 對 重 點 回 答 是 很 重 要 的 ; 不 確 定 的 請 一 定 要 當 場 提 出 來, 不 要 白 花 力 氣 在 誤 會

More information

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40

C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer

More information

Microsoft PowerPoint - Lecture7II.ppt

Microsoft PowerPoint - Lecture7II.ppt Lecture 8II SUDOKU PUZZLE SUDOKU New Play Check 軟體實作與計算實驗 1 4x4 Sudoku row column 3 2 } 4 } block 1 4 軟體實作與計算實驗 2 Sudoku Puzzle Numbers in the puzzle belong {1,2,3,4} Constraints Each column must contain

More information

Tree

Tree 樹狀結構 Tree 講師 : 洪安 大綱 樹 (Tree) 二元樹 (Binary Tree) 二元搜尋樹 (Binary Search Tree) 課堂練習 2 樹 樹 (Tree) 是一種模擬現實生活中樹幹和樹枝的資料結構, 屬於一種階層架構的非線性資料結構, 例如 : 家族族譜, 決策模型 3 樹的基本術語 樹的樹根稱為 根節點 (Root), 在根節點之下是樹的樹枝, 擁有 0 到 n 個

More information

Explain each of the following terms. (12%) (a) O(n 2 ) (b) protected in C++ language (c) sparse matrix 7. Write

Explain each of the following terms. (12%) (a) O(n 2 ) (b) protected in C++ language (c) sparse matrix 7. Write Department of Computer Science and Engineering National Sun Yat-sen University Data Structures - Middle Exam, Nov. 20, 2017 1. Suppose an array is declared as a[5][6][4], where the address of a[0][0][0]

More information

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf ("%d", & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf ("%d %d

2013 C 1 # include <stdio.h> 2 int main ( void ) 3 { 4 int cases, a, b, i; 5 scanf (%d, & cases ); 6 for (i = 0;i < cases ;i ++) 7 { 8 scanf (%d %d 2013 18 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp, Compilation Error cin scanf Time Limit Exceeded 1: A 5 B 5 C 5 D 5 E 5 F 5 1 2013 C 1 # include 2 int main ( void ) 3 { 4 int cases, a, b,

More information

第七讲 继承与多态

第七讲  继承与多态 第 七 章 继 承 与 派 生 1 本 章 主 要 内 容 的 继 承 成 员 的 访 问 控 制 单 继 承 与 多 继 承 派 生 的 构 造 析 构 函 数 成 员 的 标 识 与 访 问 深 度 探 索 2 的 继 承 与 派 生 的 继 承 与 派 生 保 持 已 有 的 特 性 而 构 造 新 的 过 程 称 为 继 承 在 已 有 的 基 础 上 新 增 自 己 的 特 性 而 产 生

More information

Microsoft Word - chap10.doc

Microsoft Word - chap10.doc 78 10. Inheritance in C++ 我 們 已 介 紹 了 物 件 導 向 程 式 的 第 一 個 主 要 特 性, 即 程 式 可 模 組 化 成 為 類 別 ( 物 件 ), 類 別 具 有 資 料 封 裝 的 特 性 接 下 來 我 們 要 介 紹 物 件 導 向 程 式 的 另 一 個 主 要 特 性, 那 就 是 類 別 具 有 繼 承 的 功 能 繼 承 就 是 重 複

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

Business Objects 5.1 Windows BusinessObjects 1

Business Objects 5.1 Windows BusinessObjects 1 Business Objects 5.1 Windows BusinessObjects 1 BusinessObjects 2 BusinessObjects BusinessObjects BusinessObjects Windows95/98/NT BusinessObjects Windows BusinessObjects BusinessObjects BusinessObjects

More information

untitled

untitled 1 1.1 1.2 1.3 1.4 1.5 ++ 1.6 ++ 2 BNF 3 4 5 6 7 8 1.2 9 1.2 IF ELSE 10 1.2 11 1.2 12 1.3 Ada, Modula-2 Simula Smalltalk-80 C++, Objected Pascal(Delphi), Java, C#, VB.NET C++: C OOPL Java: C++ OOPL C# C++

More information

Fuzzy Highlight.ppt

Fuzzy Highlight.ppt Fuzzy Highlight high light Openfind O(kn) n k O(nm) m Knuth O(n) m Knuth Unix grep regular expression exact match Yahoo agrep fuzzy match Gais agrep Openfind gais exact match fuzzy match fuzzy match O(kn)

More information

投影片 1

投影片 1 資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection

More information

自动化接口

自动化接口 基 于 文 件 的 数 据 交 换 的 注 意 事 项 1 SPI 2 COMOS Automation 操 作 手 册 通 用 Excel 导 入 3 通 过 OPC 客 户 端 的 过 程 可 视 化 4 SIMIT 5 GSD 6 05/2016 V 10.2 A5E37093378-AA 法 律 资 讯 警 告 提 示 系 统 为 了 您 的 人 身 安 全 以 及 避 免 财 产 损 失,

More information

Chapter 16 集合

Chapter 16 集合 Chapter 16 集合 20 ArrayList StringCollection 16 本章學習目標 : ArrayList ArrayList Array StringCollection 16-1 21 10-3-8 System.Array Clear Clear 16-1 Clear System.Array Microsoft System.Collection IList 542

More information

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF>

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF> 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 考 试 2009 年 上 半 年 软 件 设 计 师 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

ebook14-4

ebook14-4 4 TINY LL(1) First F o l l o w t o p - d o w n 3 3. 3 backtracking parser predictive parser recursive-descent parsing L L ( 1 ) LL(1) parsing L L ( 1 ) L L ( 1 ) 1 L 2 L 1 L L ( k ) k L L ( 1 ) F i r s

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

Microsoft Word - MSP430 Launchpad 指导书.docx

Microsoft Word - MSP430 Launchpad 指导书.docx Contents 3... 9... 14 MSP430 LAUNCHPAD 指导书 3 第一部分第一个工程 New Project File > New > CCS Project Project name: ButtonLED Device>Family: MSP430 Variant: MSP430G2553 Project templates and examples : Empty Project

More information

VHDL(Statements) (Sequential Statement) (Concurrent Statement) VHDL (Architecture)VHDL (PROCESS)(Sub-program) 2

VHDL(Statements) (Sequential Statement) (Concurrent Statement) VHDL (Architecture)VHDL (PROCESS)(Sub-program) 2 VHDL (Statements) VHDL(Statements) (Sequential Statement) (Concurrent Statement) VHDL (Architecture)VHDL (PROCESS)(Sub-program) 2 (Assignment Statement) (Signal Assignment Statement) (Variable Assignment

More information

Chn 116 Neh.d.01.nis

Chn 116 Neh.d.01.nis 31 尼 希 米 书 尼 希 米 的 祷 告 以 下 是 哈 迦 利 亚 的 儿 子 尼 希 米 所 1 说 的 话 亚 达 薛 西 王 朝 二 十 年 基 斯 流 月 *, 我 住 在 京 城 书 珊 城 里 2 我 的 兄 弟 哈 拿 尼 和 其 他 一 些 人 从 犹 大 来 到 书 珊 城 我 向 他 们 打 听 那 些 劫 后 幸 存 的 犹 太 人 家 族 和 耶 路 撒 冷 的 情 形

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice 路 ESW 聯 USB Chapter 9 Applications For Windows Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice USB I/O USB / USB 3 料 2 1 3 路 USB / 列 料 料 料 LED

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

C 1

C 1 C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=

More information

PowerPoint Presentation

PowerPoint Presentation Visual Basic 2005 學 習 範 本 第 7 章 陣 列 的 活 用 7-1 陣 列 當 我 們 需 要 處 理 資 料 時, 都 使 用 變 數 來 存 放 資 料 因 為 一 個 變 數 只 能 代 表 一 個 資 料, 若 需 要 處 理 100 位 同 學 的 成 績 時, 便 要 使 用 100 個 不 同 的 變 數 名 稱, 這 不 但 會 增 加 變 數 名 稱 命 名

More information

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO CHAPTER 使用 Hadoop 打造自己的雲 8 8.3 測試 Hadoop 雲端系統 4 Nodes Hadoop Map Reduce Hadoop WordCount 4 Nodes Hadoop Map/Reduce $HADOOP_HOME /home/ hadoop/hadoop-0.20.2 wordcount echo $ mkdir wordcount $ cd wordcount

More information

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1.

Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE Project Properties IDE makefile 1. Oracle Solaris Studio 12.2 IDE 2010 9 2 8 9 10 11 13 20 26 28 30 32 33 Oracle Solaris Studio makefile C C++ Fortran IDE Solaris Linux C/C++/Fortran IDE "Project Properties" IDE makefile 1. "File" > "New

More information

(Microsoft PowerPoint - UML\302\262\244\266_use case.ppt)

(Microsoft PowerPoint - UML\302\262\244\266_use case.ppt) UML 簡 介 _Use Case Diagram 資 訊 科 技 系 林 偉 川 UML 簡 介 2 1 UML UML 是 Unified Modeling Language 的 縮 寫, 中 文 翻 譯 為 統 一 塑 模 語 言 UML 統 合 了 物 件 導 向 方 法 論 之 各 派 不 同 的 方 法, 提 供 了 一 致 性 的 圖 形 語 言 做 為 開 發 系 統 的 溝 通 媒

More information

《大话设计模式》第一章

《大话设计模式》第一章 第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜

More information

投影片 1

投影片 1 Discrete Mathematics Chapter-10 Trees Introduction to Tree ( 10.1) Def 1. A connected (undirected) graph that contains no simple circuits is called a tree. Trees are particularly useful in computer science,

More information

Improved Preimage Attacks on AES-like Hash Functions: Applications to Whirlpool and Grøstl

Improved Preimage Attacks on AES-like Hash Functions: Applications to Whirlpool and Grøstl SKLOIS (Pseudo) Preimage Attack on Reduced-Round Grøstl Hash Function and Others Shuang Wu, Dengguo Feng, Wenling Wu, Jian Guo, Le Dong, Jian Zou March 20, 2012 Institute. of Software, Chinese Academy

More information

Microsoft Word - PHP7Ch01.docx

Microsoft Word - PHP7Ch01.docx PHP 01 1-6 PHP PHP HTML HTML PHP CSSJavaScript PHP PHP 1-6-1 PHP HTML PHP HTML 1. Notepad++ \ch01\hello.php 01: 02: 03: 04: 05: PHP 06:

More information

D C 93 2

D C 93 2 D9223468 3C 93 2 Java Java -- Java UML Java API UML MVC Eclipse API JavadocUML Omendo PSPPersonal Software Programming [6] 56 8 2587 56% Java 1 epaper(2005 ) Java C C (function) C (reusability) eat(chess1,

More information

untitled

untitled 1 5 IBM Intel 1. IBM 第 1/175 页 第 2/175 页 第 3/175 页 80 第 4/175 页 2. IBM 第 5/175 页 3. (1) 第 6/175 页 第 7/175 页 第 8/175 页 = = 第 9/175 页 = = = = = 第 10/175 页 = = = = = = = = 3. (2) 第 11/175 页 第 12/175 页 第 13/175

More information

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS C H P T E R 7 Windows Vista Windows Vista Windows VistaFT16 FT32NTFS NTFSNew Technology File System NTFS 247 6 7-1 Windows VistaTransactional NTFS TxFTxF Windows Vista MicrosoftTxF CIDatomicity - Consistency

More information

文档 3

文档 3 1 2 3 4 5 6 / A B A B B A 7 8 9 10 11 12 OO A B A B 13 14 15 16 17 18 19 20 21 22 OOA OOA 23 24 25 OOA OOA 26 27 28 29 30 31 32 use case 33 use case 34 35 36 37 OOD OOA OOD 38 OOA 39 OOD 40 41 / 42 OOD

More information

四川省普通高等学校

四川省普通高等学校 四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9

More information

Perl

Perl Perl 磊 Goal Introduction The first perl program Basical coding style Variable Data structure Control structure Regular expression Lab Reference Outline The first perl program Just type this following string

More information

All Rights Reserved, National Library Board, Singapore All Rights Reserved, National Library Board, Singapore All Rights Reserved, National Library Board, Singapore All Rights Reserved, National Library

More information