1

Size: px
Start display at page:

Download "1"

Transcription

1 基本練習題 1. 答 : 鄰接矩陣 : D E D E D E D E 鄰接串列 : List[] List[] E List[] E List[] D E List[D] E List[E] D List[] List[] D List[] List[] E List[D] E List[E]

2 2. 答 : D E D E D E D E List[] List[] List[] List[] List[D] 1 4 E D 2 E 5 2 E 2 List[E] 3 5 D 2 List[] List[] List[] List[] List[D] List[E] E 3 5 D E 2

3 3. 答 : 動作說明 佇列 (queue) 已拜訪頂點 初始狀態 front rear 拜訪, Enqueue() Dequeue 得, 將所有與 相鄰 且未被拜訪的頂點一一拜訪且 Enqueue,(,),, Dequeue 得, 將所有與 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,(D,E) D E,,,D,E Dequeue 得, 將所有與 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,(F,G) D E F G,,,D,E, F,G Dequeue 得 D, 將所有與 D 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,(H) E F G H,,,D,E,F G,H Dequeue 得 E, 將所有與 E 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,( 無 ) F G H,,,D,E,F G,H Dequeue 得 F, 將所有與 F 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,(I) G H I,,,D,E,F G,H,I Dequeue 得 G, 將所有與 G 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,( 無 ) H I,,,D,E,F G,H,I

4 Dequeue 得 H, 將所有與 H 相鄰且未被拜訪的頂點一一拜訪且 Enqueue,( 無 ) I,,,D,E,F G,H,I Dequeue 得 I, 將所有與 I 相鄰且 未被拜訪的頂點一一拜訪且 Enqueue,( 無 ),,,D,E,F G,H,I 佇列已空, 停止 4. 答 : 動作說明 堆疊 ( stack ) 已拜訪頂點 初始狀態 top 將起點 推入堆疊 拜訪, 將所有與 相鄰且未被拜訪的頂點一一推入堆疊 Push(,) Pop 得, 拜訪, 將所有與 相鄰且未被拜訪的頂點一一 Push,(E,F,G) Pop 得 G, 拜訪 G, 將所有與 G 相鄰且未被拜訪的頂點一一 Push,(I) Pop 得 I, 拜訪 I, 將所有與 I 相鄰且未被拜訪的頂點一一 Push,(F) Pop 得 F, 拜訪 F, 將所有與 F 相鄰且未被拜訪的頂點一一 Push,( 無 ) G F E I F E F F E F E,,,G,,G,I,,G,I,F

5 Pop 得 F, F 已拜訪過 E,,G, I, F Pop 得 E, 拜訪 E, 將所有與 E 相鄰且未被拜訪的頂點一一 Push,() Pop 得, 拜訪, 將所有與 相鄰且未被拜訪的頂點一一 Push,(D) Pop 得 D, 拜訪 D, 將所有與 D 相鄰且未被拜訪的頂點一一 Push,(H) Pop 得 H, 拜訪 H, 將所有與 H 相鄰且未被拜訪的頂點一一 Push,( 無 ) Pop 得, 已被拜訪, 堆疊已空, 停止 D H,,G, I, F, E,,G, I, F, E,,G, I, F, E,D,,G, I, F, E,D,H,,G, I, F, E,D,H 5. 答 : D 3 F 2 E 6. 答 : D F 2 E

6 7. 答 : D E F G 進階練習題 1. 答 : 不一定是唯一的 當有多個邊加權相同而且任選一邊加入都不會構成環路時, 任選一邊均可, 但可能因而造成不同的最少花費展開樹 例如下圖, 邊 (,) 和 (,D) 邊長均為 2, 選擇任一個都是正確的, 但會造成兩棵不同的最少花費展開樹 D 2 2 圖形 G D 1 D 2 2 最少花費展開樹 1 最少花費展開樹 2 2. 答 : Decided vertices V1 V2 V3 V4 V5 V6 V0 4/0 5/0 3/0 /0 /0 /0 V0,V1 4/0 4/3 /0 9/3 11/3 V0,V1,V2 4/3 8/1 9/3 11/3 V0V1V2V3 8/1 6/2 11/3 V0V1V3V2V4 8/1 10/5 V0V1V3V2V4V5 10/5 V0 到 V6 的最短距離為 :10 V0 到 V6 的最短路徑為 :V6 <- V5 <- V2 <-V3<- V0, 亦即 V0 -> V3 -> V2 ->

7 V5->V6 V0 至其餘各點以此類推 3. 答 : 先算出每個頂點的最早時間和最晚時間 頂 點 D E F G 最早時間 最晚時間 因此到達頂點 G 的最早時間為 16 再算出每個工作的最早時間和最晚時間 工 作 D E D D DF DG EG FG 最早時間 最晚時間 最早時間和最晚時間相等的, 即為關鍵路徑上的邊 因此關鍵路徑為 : -> -> D -> F -> G n 4. 答 :(D) M ( i, j) /2 n i= 1 j = 1 5. 答 :(D) 程式題 1. 答 : #include <stdio.h> #include <stdlib.h> #define MX_ITEM 20 #define MX_V 20 /* 最多頂點數目 */

8 void FS(); void Visit(); int Enqueue(); int Dequeue(); int IsEmpty(); char Find_dj(); void ReaddjMatrix(); typedef struct tagqueue int item[mx_item]; int front; int rear; QUEUE; QUEUE q; int RealV; int ol; int Visited[MX_V]; int [MX_V][MX_V]; void main(void) int V0; ReaddjMatrix(); printf(" 請輸入起點 : "); scanf("%d",&v0); FS(V0); void ReaddjMatrix(void) int i,j; FILE *fin; if ((fin=fopen("fs.dat","r")) == NULL ) printf("fs.dat Not Found!\n"); exit(1); fscanf(fin,"%d",&realv); if (RealV>MX_V)

9 RealV = MX_V; for ( i=0 ; i<realv; i++) for (j=0; j<realv; j++) fscanf(fin,"%d",&[i][j]); fclose(fin); void FS (int V0) int Vx,Vy; Visit(V0); Enqueue(V0); while(!isempty()) Dequeue(&Vx); Vy=Find_dj(Vx,1); while(vy!=-1) Visit(Vy); Enqueue(Vy); Vy=Find_dj(Vx,0); void Visit(int Vx) Visited[Vx]=1; printf("v%2d\n",vx); int Enqueue(int Vx) if ((q.rear+1)%mx_item==q.front) return(0); q.rear=(q.rear+1)%mx_item; q.item[q.rear]=vx; return(1); int Dequeue(int *Vx)

10 if(isempty()) return(0); q.front=((q.front+1)%mx_item); *Vx=q.item[q.front]; return(1); int IsEmpty() if(q.front == q.rear) return (1); return (0); char Find_dj(int Vx,char first) if (first) ol=0; ol++; while(ol < RealV) if ([Vx][ol]==0 Visited[ol]) ol++; return (ol); return (-1); FS.dat 的內容

11 答 : #include <stdio.h> #include <stdlib.h> #define MX_ITEM 20 #define MX_V 20 /* 最多頂點數目 */ typedef struct tagstk int item[mx_item]; /* 資料欄位 */ int top; STK; STK S; void DFS(); void Visit(); char Find_dj(); int PUSH(),IsFull(),POP(),IsEmpty(); void ReaddjMatrix(); int RealV; int ol; int Visited[MX_V]; int [MX_V][MX_V];

12 void main(void) int V0; ReaddjMatrix(); printf(" 請輸入起點 :"); scanf("%d",&v0); DFS(V0); void ReaddjMatrix(void) int i,j; FILE *fin; if ((fin=fopen("dfs.dat","r")) == NULL ) printf("dfs.dat Not Found!\n"); exit(1); fscanf(fin,"%d",&realv); if (RealV>MX_V) RealV = MX_V; for ( i=0 ; i<realv; i++) for (j=0; j<realv; j++) fscanf(fin,"%d",&[i][j]); fclose(fin); void DFS(int V0) int Vx,Vy; PUSH (V0); while(!isempty(&s)) POP (&Vx); if(!visited[vx]) Visit(Vx); Vy=Find_dj(Vx,1); while(vy!=-1) PUSH(Vy); Vy=Find_dj(Vx,0);

13 void Visit(int Vx) Visited[Vx]=1; printf("v%2d\n",vx); char Find_dj(int Vx,char first) if (first) ol=0; ol++; while(ol < RealV) if ([Vx][ol]==0 Visited[ol]) ol++; return (ol); return(-1); int PUSH(int X) if(isfull(&s)) return(0); S.top=S.top+1; S.item[S.top]=X; return(1); int IsFull(STK *s) if (s->top == (MX_ITEM-1)) return(1);

14 return(0); int POP(int *X) if(isempty(&s)) return (0); *X=S.item[S.top]; S.top--; return(1); int IsEmpty(STK *s) if(s->top == -1) return(1); return(0); DFS.dat 的內容

15 3 答 : #include <stdio.h> #include <stdlib.h> #define MX_ITEM 20 #define MX_V 20 /* 最多頂點數目 */ void FS(int); void Visit(int); int Enqueue(); int Dequeue(); int IsEmpty(); char Find_dj(); void ReaddjList(); void InsertNode(int,int); typedef struct tagqueue int item[mx_item]; int front; int rear; QUEUE; QUEUE q; int RealV; int Visited[MX_V]; typedef struct tagnode int data; struct tagnode *next; NODE; NODE [MX_V]; NODE *ol; void main(void) int V0; ReaddjList();

16 printf(" 請輸入起點 : "); scanf("%d",&v0); FS(V0); void InsertNode(int Row,int ol) NODE *p,*newnode; for( p=&[row]; (p->next!=null)&&(p->data<ol); p=p->next); if ((NewNode=(NODE *)malloc(sizeof(node))) ==NULL) return; NewNode->data=ol; NewNode->next=p->next; p->next = NewNode; void ReaddjList(void) int i,j,indata; FILE *fin; if ((fin=fopen("fs.dat","r")) == NULL ) printf("fs.dat Not Found!\n"); exit(1); fscanf(fin,"%d",&realv); if (RealV>MX_V) RealV = MX_V; for ( i=0 ; i<realv; i++) [i].next = NULL; for (j=0; j<realv; j++) fscanf(fin,"%d",&indata); if (InData==1) InsertNode(i,j); fclose(fin); void FS (int V0)

17 int Vx,Vy; Visit(V0); Enqueue(V0); while(!isempty()) Dequeue(&Vx); Vy=Find_dj(Vx,1); while(vy!=-1) Visit(Vy); Enqueue(Vy); Vy=Find_dj(Vx,0); void Visit(int Vx) Visited[Vx]=1; printf("v%2d\n",vx); int Enqueue(int Vx) if ((q.rear+1)%mx_item==q.front) return(0); q.rear=(q.rear+1)%mx_item; q.item[q.rear]=vx; return(1); int Dequeue(int *Vx) if(isempty()) return(0); q.front=((q.front+1)%mx_item); *Vx=q.item[q.front]; return(1);

18 int IsEmpty() if(q.front == q.rear) return (1); return (0); char Find_dj(int Vx,char first) if (first) ol=[vx].next; ol=ol->next; while(ol!= NULL) if (Visited[ol->data]) ol=ol->next; return (ol->data); return (-1); 4 答 : #include <stdio.h> #include <stdlib.h> #include <conio.h> #define MX_ITEM 20 #define MX_V 20 /* 最多頂點數目 */ void FS(); void ddedge(int,int); void Visit(); int Enqueue(); int Dequeue(); int IsEmpty(); char Find_dj();

19 void ReaddjMatrix(); typedef struct tagqueue int item[mx_item]; int front; int rear; QUEUE; QUEUE q; int RealV; int ol; int Visited[MX_V]; int [MX_V][MX_V]; void main(void) int V0; ReaddjMatrix(); printf(" 請輸入起點 : "); scanf("%d",&v0); FS(V0); getch(); void ReaddjMatrix(void) int i,j; FILE *fin; if ((fin=fopen("fs.dat","r")) == NULL ) printf("fs.dat Not Found!\n"); exit(1); fscanf(fin,"%d",&realv); if (RealV>MX_V) RealV = MX_V; for ( i=0 ; i<realv; i++) for (j=0; j<realv; j++) fscanf(fin,"%d",&[i][j]); fclose(fin);

20 void FS (int V0) int Vx,Vy; Visit(V0); Enqueue(V0); while(!isempty()) Dequeue(&Vx); Vy=Find_dj(Vx,1); while(vy!=-1) Visit(Vy); ddedge(vx,vy); Enqueue(Vy); Vy=Find_dj(Vx,0); void ddedge(int Vx,int Vy) printf("dd Edge (V%2d,V%2d)\n",Vx,Vy); void Visit(int Vx) Visited[Vx]=1; printf("v%2d\n",vx); int Enqueue(int Vx) if ((q.rear+1)%mx_item==q.front) return(0); q.rear=(q.rear+1)%mx_item; q.item[q.rear]=vx; return(1);

21 int Dequeue(int *Vx) if(isempty()) return(0); q.front=((q.front+1)%mx_item); *Vx=q.item[q.front]; return(1); int IsEmpty() if(q.front == q.rear) return (1); return (0); char Find_dj(int Vx,char first) if (first) ol=0; ol++; while(ol < RealV) if ([Vx][ol]==0 Visited[ol]) ol++; return (ol); return (-1);

22 5. 答 : #include <stdio.h> #include <stdlib.h> #define MX_ITEM 20 #define MX_V 20 /* 最多頂點數目 */ typedef struct tagstk int item[mx_item]; /* 資料欄位 */ int top; STK; STK S; void DFS(); void ddedge(int,int); void Visit(); char Find_dj(); int PUSH(),IsFull(),POP(),IsEmpty(); void ReaddjMatrix(); int RealV; int ol; int Visited[MX_V]; int [MX_V][MX_V]; void main(void) int V0; ReaddjMatrix(); printf(" 請輸入起點 :"); scanf("%d",&v0); DFS(V0); void ReaddjMatrix(void) int i,j; FILE *fin; if ((fin=fopen("dfs.dat","r")) == NULL )

23 printf("dfs.dat Not Found!\n"); exit(1); fscanf(fin,"%d",&realv); if (RealV>MX_V) RealV = MX_V; for ( i=0 ; i<realv; i++) for (j=0; j<realv; j++) fscanf(fin,"%d",&[i][j]); fclose(fin); void DFS(int Vs) int Vx,Tempol; Visit(Vs); Vx=Find_dj(Vs,1); while(vx!=-1) Tempol=ol; ddedge(vs,vx); DFS(Vx); ol=tempol; Vx=Find_dj(Vs,0); void ddedge(int Vx,int Vy) printf("dd Edge (V%2d,V%2d)\n",Vx,Vy); void Visit(int Vx) Visited[Vx]=1; printf("v%2d\n",vx); char Find_dj(int Vx,char first)

24 if (first) ol=0; ol++; while(ol < RealV) if ([Vx][ol]==0 Visited[ol]) ol++; return (ol); return(-1); int PUSH(int X) if(isfull(&s)) return(0); S.top=S.top+1; S.item[S.top]=X; return(1); int IsFull(STK *s) if (s->top == (MX_ITEM-1)) return(1); return(0); int POP(int *X) if(isempty(&s)) return (0); *X=S.item[S.top]; S.top--; return(1);

25 int IsEmpty(STK *s) if(s->top == -1) return(1); return(0); 6. 答 : #define MX_V 20 /* 最多頂點數目 */ int RealV; typedef struct tagnode int data; struct tagnode *next; NODE; NODE [MX_V]; void InsertNode(int Row,int ol) NODE *p,*newnode; for( p=&[row]; (p->next!=null)&&(p->data<ol); p=p->next); if ((NewNode=(NODE *)malloc(sizeof(node))) ==NULL) return; NewNode->data=ol; NewNode->next=p->next; p->next = NewNode; void ReaddjList(void) int i,j,indata; FILE *fin; if ((fin=fopen("fs.dat","r")) == NULL ) printf("fs.dat Not Found!\n");

26 exit(1); fscanf(fin,"%d",&realv); if (RealV>MX_V) RealV = MX_V; for ( i=0 ; i<realv; i++) [i].next=null; for (j=0; j<realv; j++) fscanf(fin,"%d",&indata); if (InData==1) InsertNode(i,j); fclose(fin); 7. 答 : #include <stdio.h> #include <stdlib.h> #define MX_V 20 int Real_V; int OST[MX_V][MX_V]; int [MX_V][MX_V],P[MX_V][MX_V]; void Floyd(void); void SearchPath(); void ReadWeightedM(void); // Read Weighted djacency Matrix from file Floyd.dat void main(void) ReadWeightedM(); Floyd(); SearchPath(P);

27 void ReadWeightedM(void) int i,j; FILE *fin; if ((fin=fopen("floyd.dat","r")) == NULL) printf("floyd.dat Not Found!"); exit(1); fscanf(fin,"%d",&real_v); for (i=0; i<real_v; i++) for (j=0; j<real_v;j++) fscanf(fin,"%d",&ost[i][j]); fclose(fin); void Floyd(void) int i,j,k; for(i=0;i <Real_V;i++) for(j=0;j < Real_V;j++) [i][j]=ost[i][j]; P[i][j]=j; for(k=0;k < Real_V;k++) for(i=0;i < Real_V;i++) for(j=0;j < Real_V;j++) if([i][j] > [i][k]+[k][j]) [i][j]=[i][k]+[k][j]; P[i][j]=P[i][k]; void SearchPath(int P[][MX_V])

28 int i,j,row; for(i=0;i < Real_V;i++) for(j=0;j < Real_V;j++) printf("shortest Path from V%d to V%d cost is:%d\n",i,j,[i][j]); printf("shortest path is:\n from v%d",i); row=p[i][j]; while(row!= j) printf(" to V%d",row); row=p[row][j]; printf(" to V%d\n",row);

1

1 基本練習題 1 答 :(A) 2 答 :(B) 3 答 :(C) 4 答 :(B) 5 答 :(D) 6 答 :2 7 答 :(B) 8 答 : (A) A B C / D E * + F G / - (B) A B + C D - * E / (C) A B C * + E F + - 9 答 : (A) - + A * - / BCDE / F G (B) / * + A B C D E (C)

More information

Microsoft Word - DataStruct-981.doc

Microsoft Word - DataStruct-981.doc 4. 堆疊與佇列 (Stack and Queue) 4. Stak (). 基本觀念 定義 : 當將東西疊成一堆, 而取用的時候由上方來取出 特性 : 先進後出, 後進先出 ( 號球先放, 但 3 號球會先拿出 ) 2 3 3 2 (2). Stack 的運算 基本運算 push: 將資料放入堆疊 pop: 將資料由堆疊最頂端取出一個 TopItem: 位於堆疊中最上面的一個資料 IsEmpty:

More information

Microsoft Word - F7801B_ch04習題解答.doc

Microsoft Word - F7801B_ch04習題解答.doc 基本練習題 1. 要將中序式轉成後序式, 需要用到何種資料結構? (A) 堆疊 (B) 佇列 (C) 堆積 (D) B 樹答 :(A) 2. 下列何者不是堆疊的應用場合?(A) 運算式轉換 (B) 工作排程 (C) 副程式的呼叫與返回 (D) 後序式的求值答 :(B) 3. 一個原來為空的堆疊, 經過 Push(1),Push(2),Pop(),Push(3),Pop(),Push(4) 則 堆疊中的資料由上而下順序是

More information

Microsoft PowerPoint - Fig03_Stack.ppt [相容模式]

Microsoft PowerPoint - Fig03_Stack.ppt [相容模式] 四 堆疊與佇列 (Stack & Queue) 4-. 串列及鏈結串列 4-. 用陣列結構實作堆疊 4-3. 用鏈結串列實作堆疊 4-4. 堆疊的應用 4-5. 佇列 4-6. 用陣列結構實作佇列 4-7 7. 用鏈結串列實作佇列 堆疊的基本觀念. 定義 : 4- 堆疊 當將東西疊成一堆, 而取用的時候由上方來取出. 特性 : 先進後出, 後進先出 ( 號球先放, 但 3 號球會先拿出 ) 3 3

More information

untitled

untitled 1 DBF (READDBF.C)... 1 2 (filetest.c)...2 3 (mousetes.c)...3 4 (painttes.c)...5 5 (dirtest.c)...9 6 (list.c)...9 1 dbf (readdbf.c) /* dbf */ #include int rf,k,reclen,addr,*p1; long brec,erec,i,j,recnum,*p2;

More information

新・明解C言語入門編『索引』

新・明解C言語入門編『索引』 !... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177

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

38 47995529 威 福 髮 藝 店 桃 園 市 蘆 竹 區 中 山 里 福 祿 一 街 48 號 地 下 一 樓 50,000 獨 資 李 依 純 105/04/06 府 經 登 字 第 1059003070 號 39 47995534 宏 品 餐 飲 桃 園 市 桃 園 區 信 光 里 民

38 47995529 威 福 髮 藝 店 桃 園 市 蘆 竹 區 中 山 里 福 祿 一 街 48 號 地 下 一 樓 50,000 獨 資 李 依 純 105/04/06 府 經 登 字 第 1059003070 號 39 47995534 宏 品 餐 飲 桃 園 市 桃 園 區 信 光 里 民 1 08414159 惠 鴻 眼 鏡 行 桃 園 市 中 壢 區 福 德 里 中 華 路 一 段 186 號 1 樓 30,000 獨 資 宋 耀 鴻 105/04/27 府 經 登 字 第 1059003866 號 2 17891110 承 元 冷 氣 空 調 工 程 行 桃 園 市 桃 園 區 中 德 里 國 際 路 1 段 98 巷 50 號 2 樓 之 4 200,000 獨 資 詹 安 平

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

1

1 基本練習題 1. 請將下面的二元樹表示成一維陣列 A B C D E F G 答 : [0] [1] [2] [3] [4] [5] [6] [7] [11] A B C D E F G 2. 將上題的二元樹表示成二維陣列 答 : [0] [1] [2] [0] A 1 2 [1] B 3 0 [2] C 4 5 [3] D 0 0 [4] E 6 0 [5] F 0 0 [6] G 0 0 3.

More information

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc

Microsoft Word - 把时间当作朋友(2011第3版)3.0.b.07.doc 2 5 8 11 0 1. 13 2. 15 3. 18 1 1. 22 2. 25 3. 27 2 1. 35 2. 38 3. 41 4. 43 5. 48 6. 50 3 1. 56 2. 59 3. 63 4. 65 5. 69 13 22 35 56 6. 74 7. 82 8. 84 9. 87 10. 97 11. 102 12. 107 13. 111 4 114 1. 114 2.

More information

(Microsoft Word - 01\277n\306{\271q\250\256.doc)

(Microsoft Word - 01\277n\306{\271q\250\256.doc) 東 野 圭 吾 短 篇 集 1 積 鬱 電 車 這 時 間 的 電 車 內 總 是 這 幅 光 景, 日 復 一 日 剛 過 晚 上 八 點, 這 輛 從 都 心 駛 往 郊 外 的 私 鐵 ( 日 本 民 營 鐵 路 局 ) 快 車 內 頗 擁 擠, 雖 不 至 於 擠 到 無 法 動 彈, 要 攤 開 報 紙 來 看 是 不 太 可 能 的 這 天 是 非 假 日, 乘 客 自 然 多 是 上

More information

4-2 1. 使 用 一 般 佇 列 存 放 資 料 時, 當 前 端 (Front) 尚 有 空 位 時, 再 加 入 元 素, 卻 發 現 此 佇 列 已 滿, 請 問 此 時 使 用 下 列 那 一 個 方 法 較 佳? (A) 優 先 佇 列 (B) 環 形 佇 列 (C) 雙 向 佇 列

4-2 1. 使 用 一 般 佇 列 存 放 資 料 時, 當 前 端 (Front) 尚 有 空 位 時, 再 加 入 元 素, 卻 發 現 此 佇 列 已 滿, 請 問 此 時 使 用 下 列 那 一 個 方 法 較 佳? (A) 優 先 佇 列 (B) 環 形 佇 列 (C) 雙 向 佇 列 CHAPTER 4 隨 書 光 碟 4-1 4-3 環 形 佇 列 由 於 佇 列 有 一 個 問 題, 就 是 前 端 (Front) 尚 有 空 位 時, 再 加 入 元 素, 卻 發 現 此 佇 列 已 滿 此 時 的 解 決 方 法 就 是 使 用 環 形 佇 列 (Circular Queue) 定 義 是 指 一 種 環 形 結 構 的 佇 列 作 法 將 一 維 陣 列 的 第 0 個

More information

正文封面.PDF

正文封面.PDF (1999 ) 1999 1 1 1999 12 31 1 38 2 38 3 38 4 38 5 38 6 38 7 38 8 38 9 38 10 38 11 38 12 38 13 38 14 38 15 38 16 38 1 2 17 38 3.6%2.16% 13.56%3.12% 10%6.25% 10%5.88% 10%3.70% 1.10% 12.50% 13.13% 12.13%

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

epub 33-8

epub 33-8 8 1) 2) 3) A S C I I 4 C I / O I / 8.1 8.1.1 1. ANSI C F I L E s t d i o. h typedef struct i n t _ f d ; i n t _ c l e f t ; i n t _ m o d e ; c h a r *_ n e x t ; char *_buff; /* /* /* /* /* 1 5 4 C FILE

More information

untitled

untitled A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (

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

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

上海政法学院

上海政法学院 上 海 政 法 学 院 206 年 度 学 校 规 划 经 费 各 平 台 拟 立 项 项 目 公 示 名 单 项 目 类 别 教 育 教 学 改 革 平 台 ( 教 务 处 ) 三 级 项 目 名 称 ( 额 度 / 平 台 管 理 责 任 人 ) 卓 越 法 律 人 才 培 养 基 地 建 设 (40 万 ) 大 学 生 创 新 创 业 训 练 (30 万 ) 应 用 型 本 科 专 业 综 合

More information

学习MSP430单片机推荐参考书

学习MSP430单片机推荐参考书 MSP430 16 MSP430 C MSP430 C MSP430 FLASH 16 1 CPU 16 ALU 16 PC SP SR R4~R15 2 3 00-FFH 100-1FFH 4 5 1 2 51 24 27 6 1 2 3 4 5 6 4 12 SR SP SR CPU SR CPU C Z N GIE CPUOff CPU OscOff SCG0 SCG1 CPU EXIT SP

More information

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;

int *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; Memory & Pointer [email protected] 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,

More information

untitled

untitled Introduction to Programming ( 數 ) Lecture 3 Spring 2005 March 4, 2005 Lecture 2 Outline 數 料 If if 狀 if 2 (Standard Output, stdout): 料. ((Standard Input, stdin): 料. 類 數 數 數 說 printf 見 數 puts 串 數 putchar

More information

Searching and Sorting

Searching and Sorting Introduction to Programming ( 數 ) Lecture 11 Spring 2005 May 27, 2004 NCCU C prog. 1 Topics Review More on Structures Unions Dynamic Memory Allocation Linked list, Queue NCCU C prog. 2 Structure in C (

More information

【主持人】:给大家介绍一下,这次的培训是我们画刊部的第三次培训,当然今天特别有幸请来著吊的摄影家李少白老师给我们讲课

【主持人】:给大家介绍一下,这次的培训是我们画刊部的第三次培训,当然今天特别有幸请来著吊的摄影家李少白老师给我们讲课 摄 影 中 的 陌 生 感 和 熟 悉 感 看 不 见 的 故 宫 的 作 者 李 少 白 老 师 以 此 画 册 为 例, 深 刻 分 析 和 探 讨 摄 影 中 的 陌 生 感 和 熟 悉 感 看 不 见 的 故 宫 这 本 画 册 最 初 设 想 分 为 四 个 章 节 第 一 章 叫 辉 煌, 第 二 章 叫 梦 想, 第 三 章 叫 神 秘, 第 四 章 叫 飞 歌 为 什 么 分 四 个

More information

20140511

20140511 卷 九 唯 識 學 概 要 真 如 緣 起 也 有 它 不 足 的 地 方! 諸 位 法 師 慈 悲, 陳 會 長 慈 悲, 諸 位 菩 薩, 阿 彌 陀 佛! 請 大 家 打 開 講 義 第 二 十 四 面, 我 們 講 到 二 種 子 之 由 來 我 們 這 一 科 是 講 到 依 唯 識 相 安 立 緣 起, 也 就 是 說 從 唯 識 學 的 角 度 來 探 討 我 們 有 情 眾 生 生

More information

汇集全球21位医生的经验和智慧,总结出最实用的专业建议,这些都是最值得你牢记的健康提醒

汇集全球21位医生的经验和智慧,总结出最实用的专业建议,这些都是最值得你牢记的健康提醒 彙 集 全 球 21 位 醫 生 的 經 驗 和 智 慧, 總 結 出 最 實 用 的 專 業 建 議, 這 些 都 是 最 值 得 你 牢 記 的 健 康 提 醒 top1. 不 是 每 個 人 都 適 合 做 近 視 矯 行 手 術, 除 非 你 在 手 術 前 已 經 持 續 穩 定 地 佩 戴 了 一 年 以 上 的 近 視 眼 鏡 或 者 隱 形 眼 鏡 如 果 你 時 摘 時 戴 眼 鏡,

More information

1 行 业 发 展 不 平 衡 我 国 房 地 产 中 介 服 务 业 起 步 较 晚, 专 业 分 工 程 度 和 国 外 发 达 国 家 相 比 还 有 很 大 差 距 房 地 产 中 介 服 务 行 业 的 发 展 水 平 与 房 地 产 开 发 行 业 的 市 场 化 水 平 密 切 相 关

1 行 业 发 展 不 平 衡 我 国 房 地 产 中 介 服 务 业 起 步 较 晚, 专 业 分 工 程 度 和 国 外 发 达 国 家 相 比 还 有 很 大 差 距 房 地 产 中 介 服 务 行 业 的 发 展 水 平 与 房 地 产 开 发 行 业 的 市 场 化 水 平 密 切 相 关 房 地 产 中 介 服 务 : 仍 处 于 成 长 期, 市 场 空 间 巨 大 作 者 : 庞 增 华 房 地 产 中 介 服 务 业 内 的 企 业 包 括 依 法 设 立 并 具 备 房 地 产 中 介 资 格 的 房 地 产 顾 问 策 划 房 地 产 代 理 销 售 房 地 产 评 估 房 地 产 经 纪 等 中 介 服 务 机 构, 是 房 地 产 开 发 价 值 链 中 不 可 或 缺

More information

Ps22Pdf

Ps22Pdf X T T 10 1 J T 12 13 14 15 16 17 18 19 20 21 2 23 24 25 26 27 28 29 30 31 32 3 34 35 36 37 38 39 40 41 42 43 4 45 46 47 48 49 50 51 52 53 54 5 56 57 58 59 60 61 62 63 64 65 6 67 68 69 70 71 72 73 74 75

More information

Microsoft PowerPoint - os_4.ppt

Microsoft PowerPoint - os_4.ppt 行 程 資 科 系 林 偉 川 行 程 概 念 行 程 與 程 式 主 要 的 不 同 點 : 程 式 是 被 放 在 外 部 的 儲 存 裝 置 如 磁 碟 上, 而 行 程 則 被 放 在 記 憶 體 中 程 式 在 儲 存 裝 置 中 是 靜 態 的, 而 行 程 在 記 憶 體 中 是 動 態 的, 它 會 隨 著 一 些 事 件 的 發 生 而 產 生 相 對 的 改 變 行 程, 就 是

More information

_汪_文前新ok[3.1].doc

_汪_文前新ok[3.1].doc 普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向

More information

Open topic Bellman-Ford算法与负环

Open topic   Bellman-Ford算法与负环 Open topic Bellman-Ford 2018 11 5 [email protected] 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

CC213

CC213 : (Ken-Yi Lee), E-mail: [email protected] 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

Microsoft Word - ACL chapter02-5ed.docx

Microsoft Word - ACL chapter02-5ed.docx 第 2 章神奇的質數 2.1.1 什麼是質數 1 1 1 打下好基礎 - 程式設計必修的數學思維與邏輯訓練 1 1 0 10 2 3 5 7 4 6 8 9 10 4 10000 1229 1000 168 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131

More information

<4D6963726F736F667420576F7264202D20B6C0AE78B0EDAABAC0B8A740B8D65FA7EBA7BAA54EA4E5BEC7ACE3A873C24FA55AA15E2E646F63>

<4D6963726F736F667420576F7264202D20B6C0AE78B0EDAABAC0B8A740B8D65FA7EBA7BAA54EA4E5BEC7ACE3A873C24FA55AA15E2E646F63> 黃 庭 堅 遷 謫 時 期 的 戲 作 詩 鍾 美 玲 高 苑 科 技 大 學 通 識 教 育 中 心 摘 要 受 北 宋 新 舊 黨 爭 的 影 響, 黃 庭 堅 於 紹 聖 元 年 責 授 涪 州 別 駕 黔 州 安 置, 從 此 展 開 一 連 串 遷 謫 的 命 運, 最 後 卒 於 遷 謫 地 宜 州 考 察 其 遷 謫 時 期 的 詩 歌, 有 許 多 以 戲 字 為 題 的 作 品,

More information

Microsoft Word - F5.docx

Microsoft Word - F5.docx 2 目錄 5A 5A 5A 5A 高慧冰 譚雅樂 余雅瑩 周子慧 劇本... P.4-P.5 奔跑人生... P.6 唐老師... P.7 唐老師... P.8 5B 5B 5B 5B 5B 5B 徐子盈 呂惠雅 黃智昭 熊雪瑩 鍾詠晴 吳博倫 敬愛的人... P.9 偶像... P.10 冬天... P.11 春夏秋冬... P.12 唐老師... P.13 安南讓決策從此變得簡單... P.14

More information

Microsoft Word - 朗诵诵材.doc

Microsoft Word - 朗诵诵材.doc 2014 年 全 港 春 華 杯 普 通 話 朗 誦 及 拼 音 认 读 大 賽 朗 誦 誦 材 幼 稚 園 K1- 散 文 組 娃 娃 的 夢 花 兒 的 夢, 是 紅 的, 小 樹 的 夢, 是 綠 的, 露 珠 的 夢, 是 圓 的, 娃 娃 的 夢, 是 甜 的 幼 稚 園 K1- 兒 歌 組 小 白 兔 小 白 兔, 白 又 白, 兩 隻 耳 朵 豎 起 來, 愛 吃 蘿 蔔 和 青 菜,

More information

06-07周年報告template.PDF

06-07周年報告template.PDF 06 07 P.2 P.3 () P.4 P.5 () P.6 20062007 6 (55%) 1 (9%) 1 (9%) 1 (9%) 1 (9%) 1 (9%) (P.1,P.2 ) 5 6 6 0.5 0.5 0.5 / 0.5 P.7 P.8 0.5 0.5 2 1 6 5 2 1 6 5 (P.3P.6) 0.5 0.5 0.5 0.5 0.5 0.5 P.9 () 4 6 5 6 6

More information

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha

C PICC C++ C++ C C #include<pic.h> C static volatile unsigned char 0x01; static volatile unsigned char 0x02; static volatile unsigned cha CYPOK CYPOK 1 UltraEdit Project-->Install Language Tool: Language Suite----->hi-tech picc Tool Name ---->PICC Compiler Executable ---->c:hi-picinpicc.exe ( Command-line Project-->New Project-->File Name--->myc

More information

untitled

untitled 不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int

More information

static struct file_operations gpio_ctl_fops={ ioctl: gpio_ctl_ioctl, open : gpio_open, release: gpio_release, ; #defineled1_on() (GPBDAT &= ~0x1) #def

static struct file_operations gpio_ctl_fops={ ioctl: gpio_ctl_ioctl, open : gpio_open, release: gpio_release, ; #defineled1_on() (GPBDAT &= ~0x1) #def Kaise s 2410 Board setting [1]. Device Driver Device Driver Linux s Kernel ARM s kernel s3c2410_kernel2.4.18_r1.1_change.tar.bz2 /usr/src (1) #cd /usr/src (2) #tar xfj s3c2410_kernel2.4.18_r1.1_change.tar.bz2

More information

Microsoft Word - 1HF12序.doc

Microsoft Word - 1HF12序.doc 每 天 早 晨 水 果 日 報 的 頭 條, 總 有 瘋 狂 的 肥 皂 劇 在 現 實 社 會 中 上 演 著, 諸 如 友 寄 隆 輝 毆 打 計 程 車 司 機 案 014 貪 瀆 案 黑 暗 騎 士 掃 射 案 ( 美 國 ) 李 宗 瑞 淫 照 外 洩 案 等, 太 多 太 多 不 可 思 議 的 刑 事 個 案 都 活 生 生 地 搬 上 現 實 世 界 演 出 而 這 也 說 明 了

More information

Microsoft Word - 讀報看科普─人體篇_橫_.doc

Microsoft Word - 讀報看科普─人體篇_橫_.doc 教 學 緣 起 在 引 領 學 生 進 行 讀 報 心 得 分 享 與 批 判 思 考 時, 發 現 學 生 普 遍 對 科 學 知 識 性 文 章 興 趣 缺 缺 ; 再 者, 近 年, 國 小 高 年 級 課 本 選 讀 科 普 文 章, 但 學 生 學 習 往 往 不 得 其 所, 無 法 融 入 課 文 中 因 此, 教 學 者 從 國 語 日 報 中 選 了 一 些 較 貼 近 生 活 的

More information

鍟嗗搧瑙傚療鈥㈤挗鏉

鍟嗗搧瑙傚療鈥㈤挗鏉 年 报 食 用 油 可 期 稳 定 改 善 稳 定 有 余, 油 脂 将 继 续 表 现 库 存 压 力 和 高 价 值 化 价 区 的 对 抗 性 投 资 机 会 更 多 是 油 脂 内 部 结 构 以 及 其 对 粕 类 相 对 强 弱 的 变 动 同 时 有 菜 籽 油 和 棕 榈 油 的 改 善 可 预 期 相 较 于 其 它 大 多 数 商 品 的 表 现, 油 脂 系 在 2015 年

More information

Microsoft Word - 2B802內文.doc

Microsoft Word - 2B802內文.doc 行 政 法 導 讀 001 行 政 法 導 讀 大 綱 序 言 壹 行 政 法 解 題 思 維 貳 行 政 法 選 擇 題 概 覽 參 行 政 法 常 考 爭 點 一 考 題 趨 勢 二 行 政 法 考 試 上 所 關 心 的 重 點 序 言 一 行 政 法 並 不 難 行 政 法 科 目 考 題 內 容 可 以 說 是 包 羅 萬 象, 考 生 要 能 夠 精 確 掌 握 實 務 上 各 種 領

More information

東區校園中法治教育種子師資教學研習營

東區校園中法治教育種子師資教學研習營 1 錄 錄 2 3 年 律 立 蓮 理 理 行 年 例 理 念 念 力 說 參 念 律 說 老 律 不 律 念 參 參 兩 力 參 兩 4 行 年 蓮 行 兩 見 參 律 行 說 論 兩 行 狀 參 參 蓮 蘭 列 律 年 律 理 律 年 參 行 行 兩 行 行 參 聯 參 聯 行 行 理 來 5 列 利 律 論 例 老 老 狀 老 老 了 利 老 索 老 行 不 老 錄 6 老 尿 例 律 留 量

More information

閱 讀 素 材 V.S 分 組 方 式 的 差 異 化 教 學 工 具 表 班 級 :( ) 閱 讀 素 材 V.S 分 組 方 式 獨 立 閱 讀 夥 伴 閱 讀 ( 同 質 性 ) 夥 伴 閱 讀 ( 異 質 性 ) 友 善 陪 伴 虛 心 受 教 國 語 日 報 新 聞 生 活 文 藝 兒 童

閱 讀 素 材 V.S 分 組 方 式 的 差 異 化 教 學 工 具 表 班 級 :( ) 閱 讀 素 材 V.S 分 組 方 式 獨 立 閱 讀 夥 伴 閱 讀 ( 同 質 性 ) 夥 伴 閱 讀 ( 異 質 性 ) 友 善 陪 伴 虛 心 受 教 國 語 日 報 新 聞 生 活 文 藝 兒 童 差 異 化 教 學 在 老 梅 103 年 12 月 差 異 化 教 學 是 老 師 對 於 學 習 者 需 求 的 回 應, 這 句 話 雖 然 動 人, 但 要 瞭 解 每 個 學 生 不 同 的 需 求 並 予 以 回 應, 則 在 教 學 上 需 要 不 斷 的 嘗 試 觀 察 與 調 整, 老 師 不 僅 需 要 高 度 的 專 業 敏 銳 的 觀 察 十 足 的 創 意 等 等, 更 重

More information

C语言的应用.PDF

C语言的应用.PDF AVR C 9 1 AVR C IAR C, *.HEX, C,,! C, > 9.1 AVR C MCU,, AVR?! IAR AVR / IAR 32 ALU 1KBytes - 8MBytes (SPM ) 16 MBytes C C *var1, *var2; *var1++ = *--var2; AVR C 9 2 LD R16,-X ST Z+,R16 Auto (local

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

[改訂新版]C言語による標準アルゴリズム事典

[改訂新版]C言語による標準アルゴリズム事典 iii C 1991 SEND + MORE = MONEY C 100 2003 Java 2003 27 PC-9800 C BMP SVG EPS BMPSVG WindowsMacLinux Web iv int main() int main(void) EXIT_SUCCESS 0 https://github.com/okumuralab/ algo-c TEX TEX PDF PDF

More information

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF>

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

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 [email protected] C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information

Chapter 1 What is Programing Paradigm 1

Chapter 1 What is Programing Paradigm 1 An Introduction to Programing Paradigm Chase Zhang May 8, 2013 Chapter 1 What is Programing Paradigm 1 CHAPTER 1. WHAT IS PROGRAMING PARADIGM 2 Definition from Wikipedia 1. Object-oriented programming/

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

Generated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3

Generated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3 浙江大学 C 程序设计及实验 试题卷 2002-2003 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:30-10:30 注意 : 答题内容必须写在答题卷上, 写在本试题卷上无效 一. 单项选择题 ( 每题 1 分, 共 10 分 ) 1. 下列运算符中, 优先级最低的是 A.

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

!!""# $ %#" & $$ % $()! *% $!*% +,-. / 0 %%"#" 0 $%1 0 * $! $#)2 "

!!# $ %# & $$ % $()! *% $!*% +,-. / 0 %%# 0 $%1 0 * $! $#)2 ! """"""""""""""""""" " !!""# $ %#" & $$ % $()! *% $!*% +,-. / 0 %%"#" 0 $%1 0 * $! $#)2 " !"#$%#$&!!!!!!!!!!!!!!!!!!!!!!!!!!!"#$%& (& #) *+&,"-./%0 1 2"0*-"3* #4 5%&6&4"&00 78 9+& :"/;& 7< 9+& =#4-%%/

More information

C

C C 2017 4 1 1. 2. while 3. 4. 5. for 6. 2/161 C 7. 8. (do while) 9. 10. (nested loop) 11. 12. 3/161 C 1. I 1 // summing.c: 2 #include 3 int main(void) 4 { 5 long num; 6 long sum = 0L; 7 int status;

More information

CC213

CC213 : (Ken-Yi Lee), E-mail: [email protected] 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

(Microsoft PowerPoint - \270\352\256\306\265\262\272c\302\262\263\370.ppt)

(Microsoft PowerPoint - \270\352\256\306\265\262\272c\302\262\263\370.ppt) 資 料 結 構 鄭 彬 資 料 資 料 : 可 以 拿 來 利 用 的 一 些 資 訊 例 如 : 旅 遊 資 訊 氣 象 資 料 考 試 成 績 考 古 題 網 頁 報 紙 談 天 廣 告 時 刻 表 電 腦 展 的 價 目 表 導 遊 地 圖 金 融 房 地 產 軍 事 交 通 商 業 市 場 科 技 新 知 商 品 價 格 各 類 書 籍 收 支 帳 單 醫 學 電 視 收 音 機 廣 告 看

More information

Linked Lists

Linked Lists LINKED LISTS Prof. Michael Tsai 2013/3/12 2 大家來吐 Array 的槽 Array 有什麼不好? 插入新 element 1 3 4新的 24 52 空 5 刪除原本的 element 1 3 42 25 5 Time complexity= O(??) 3 Array 的複雜度 Indexing ( 拿某一個元素 ) 在開頭 Insert/Delete

More information

试卷格式

试卷格式 复 旦 大 学 计 算 机 科 学 技 术 学 院 数 据 结 构 期 末 考 试 试 卷 ( 参 考 答 案 与 评 分 标 准 ) A 卷 共 8 页 课 程 代 码 :COMP130004.01-03 考 试 形 式 : 开 卷 闭 卷 2012 年 1 月 ( 本 试 卷 答 卷 时 间 为 120 分 钟, 答 案 必 须 写 在 试 卷 上, 做 在 草 稿 纸 上 无 效 ) 专 业

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

nooog

nooog C : : : , C C,,, C, C,, C ( ), ( ) C,,, ;,, ; C,,, ;, ;, ;, ;,,,, ;,,, ; : 1 9, 2 3, 4, 5, 6 10 11, 7 8, 12 13,,,,, 2008 1 1 (1 ) 1.1 (1 ) 1.1.1 ( ) 1.1.2 ( ) 1.1.3 ( ) 1.1.4 ( ) 1.1.5 ( ) 1.2 ( ) 1.2.1

More information

Microsoft PowerPoint - DS&Algorithm [相容模式]

Microsoft PowerPoint - DS&Algorithm [相容模式] 資料結構與演算法 陳怡芬 什麼是 Data structure? 將資料群組織起來的抽象資料型態, 稱為資料結構 典型的資料結構 資料表格 (Table) 堆疊 (stack) 佇列 (queue) 串列 (list) 樹 (tree) 圖形 (graph) table, stack, queue: 可用陣列表現出來 List, tree, graph: 適合用指標表現出來 堆疊 (Stack) 將資料依序從堆疊下面儲存起來,

More information

Microsoft PowerPoint - 資料結構總複習

Microsoft PowerPoint - 資料結構總複習 Data Structure & Algorithm 陳怡芬 什麼是 Data structure? 將資料群組織起來的抽象資料型態, 稱為資料結構 1 典型的資料結構 資料表格 (Table) 堆疊 (stack) 佇列 (queue) 串列 (list) 樹 (tree) 圖形 (graph) table, stack, queue: 可用陣列表現出來 List, tree, graph: 適合用指標表現出來

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

FY.DOC

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

More information