untitled

Similar documents
untitled

最即時的Sybase ASE Server資料庫診斷工具

untitled

chap 5: Trees

Microsoft PowerPoint - PL_03-04.pptx

untitled

슬라이드 제목 없음

untitled

11강-힙정렬.ppt

國中生物教師資訊行為之研究

untitled

無線網路技術應用於802

untitled

untitled

untitled

chap01_time_complexity.key

1

untitled

PowerPoint 프레젠테이션

untitled

03장.스택.key

chap10.PDF

untitled

6장정렬알고리즘.key

5.스택(강의자료).key

C# Programming Guide - Types

untitled

untitled

강의10

untitled

untitled

Chapter 4. LISTS

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어


02 C h a p t e r Java

untitled

untitled

untitled

untitled

untitled

4.18.국가직 9급_전산직_컴퓨터일반_손경희_ver.1.hwp

PowerPoint 프레젠테이션

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

Chap 6: Graphs

6주차.key

untitled

Chapter 4. LISTS

Microsoft Word - ExecutionStack



untitled

誰是以馬內利?

心臟疾病細胞治療之臨床試驗簡介

untitled

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

ELOXATINE

6

untitled

untitled

以非無塵室製程搭配高效能數值分析技術設計與製作生醫晶片用微流體元件

SIGPLwinterschool2012

자바 프로그래밍

「藥物安全簡訊」出刊計畫

hlogin2

Let G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a set of E, possibly empty, that is includ

untitled

untitled

Microsoft PowerPoint - Chap5 [호환 모드]

Microsoft PowerPoint - 알고리즘_11주차_2차시.pptx

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600

untitled

untitled

PowerPoint 프레젠테이션

슬라이드 1

2002년 2학기 자료구조

untitled

untitled

untitled

chap8.PDF

untitled

untitled

10주차.key

untitled

Microsoft Word - FunctionCall

untitled

untitled

Microsoft PowerPoint - lecture2.ppt

OCaml

untitled

untitled



Line (A) å j a k= i k #define max(a, b) (((a) >= (b))? (a) : (b)) long MaxSubseqSum0(int A[], unsigned Left, unsigned Right) { int Center, i; long Max

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures

Chap 6: Graphs

신림프로그래머_클린코드.key

07 자바의 다양한 클래스.key

chap x: G입력

PowerPoint 프레젠테이션

01-OOPConcepts(2).PDF


untitled

Transcription:

年 識 料 ˍˍˍˍˍˍ 不 80 1.25 2 1~80 不 1 列 array A n n matrix 零 lower triangular matrix 列 來 n n(n+1)/2 n(n 1)/2 n n 2 例 行 Y[1][3] 列 INT Y[4][4]; FOR(I=0; I<4; I++) FOR(J=0; J<4; J++) Y[I][J]=2*I*J+1; Y[2][1] Y[2][2] Y[2][3] Y[3][1] 3 A[1 m][1 n] 列 byte addressable A element 2-bytes A[5][2] 1900 A[2][3] 1930 A[3][15] 2362 2364 2366 2368 4 Knuth-Morris-Pratt 度 n 串 度 p 串 p<n 狀 度 O(n+p) O(n log p) O(n p) O(n 2 ) 5 列 料 數 tree 列 queue stack 列 array 6 列 料 列 circular queue void addq(int front, int *rear, element item) { rear=(*rear+1)% MAX QUEUE SIZE; if(front= = *rear){ queue full(rear); return;} queue[ ------ ]=item; } rear *rear (*rear)+ (*rear)++ 7 列 料 不 串列 linear list tree 列 queue stack 列 array 8 stack 行 連串 push pop push a push b push c pop push b push c pop 行 abb bba abc cba 9 ABCDEFGHI prefix DCBEAGFHI infix postfix 列 DCBEHIFGA BCDAEFGHI BEDCAFGHI DCEBGHIFA 10 prefix /*+abc/d-ef infix 列 (a+b)*c/d/(e-f) a+b*c/(d/(e-f)) (a+b)*c/(d/e-f) (a+b)*c/(d/(e-f)) 11 (x,y) x y 兩 (0,4),(3,1),(6,10),(8,9),(7,4),(6,8),(3,5),(2,11),(11,0) 列 {0,2,3,5} {6,8,9,10,11} {1,3,5,8} 0,1,2,3,4,5,6,7,8,9,10,11 12 不

年 識 料 12 C 類 typedef struct list_node *list_pointer; typedef struct list_node { char data[4]; list_pointer link; }; 數 Bytes 列 list_node 度 4 串 list_node 8 Bytes link list_node 類 數 ptr list_node Null list_pointer ptr=0 13 C 什 #include<stdio.h> void main() { int a = 100, *p, **ptr; p = &a; ptr = &p; *p = 200; **ptr = 250; printf( a = %d, *p = %d, **ptr = %d\n, a, *p, **ptr); } a = 250, *p = 250, **ptr = 250 a = 100, *p = 250, **ptr = 250 a = 250, *p = 200, **ptr = 250 a = 100, *p = 200, **ptr = 250 14 列 Array 串列 Linked List 兩 列 Linked List 若 來 數列 a 1,a 2,,a n O(log 2 n) 度 數 k 數列 Array 來 Linked List Linked List Array Linked List 料 度 O(log 2 n) 若 Array Linked List 數列 若 數 k 數列 Array 15 Priority Queue 若 不 料 來 Insertion Deletion Time 不 Queue n Priority Queue 列 若 Unordered Array 來 Insertion Time = O(n), Deletion Time = O(1) 若 Sorted Array 來 Insertion Time = O(n), Deletion Time = O(1) 若 Sorted Linked List 來 Insertion Time = O(n), Deletion Time = O(1) 若 Max Heap 來 Insertion Time = O(log 2 n), Deletion Time = O(log 2 n) 16 度 Depth k Full Binary Treek1 k 2 k 2 k 1 2 k-1 17 n Node Complete Binary Tree 度 Height n1 n n log 2 n + 1 n log 2 log 2

年 識 料 18 Max Heap 13 列 Heap 19 1,2,3,4,5 Push Stack Push Pop Stack 5 都陸 Pop 來 列 Permutation 列 列 不 12345 31425 23145 45321 20 狀 Node Subtree 數 Root Degree Leaf Level 21 列 拓 列 topological order 3,0,1,2,4,6,7,8,5,9,10 0,3,1,2,4,6,7,5,9,8,10 3,5,0,1,2,4,6,8,7,9,10 0,1,2,3,4,5,6,7,8,9,10 22 n nodes e 連 edges 列 Dijkstras algorithm 路 shortest path 度 time complexity O(n 2 ) O(n log n) O(ne) O(e log e) 23 略 Kruskals algorithmdivide and conquer method Dijkstras algorithm dynamic programming quick sort branch and bound method binary search greedy method 24 連 路 連 行 若 拓 列 0 1 2 3 4 5 6 7 8 0 2 1 3 5 4 6 7 8 0 1 2 4 3 5 7 6 8 0 3 5 2 1 4 7 6 8 25 列 不 度 breadth first search 1 5 6 2 3 4 1 2 6 5 4 3 1 6 2 3 4 5 1 5 2 6 4 3

年 識 料 26 n nodes e 連 edgesundirected graph G MAX( e ) = n (n-1) e 連 數 tree graph 若 G adjacency matrix 度 depth first search O(n e) 若 G 串列 adjacency list 度 depth first search O(n+e) 27 列 sort 料 heap sort bubble sort merge sort selection sort 28 quick sort 料 5,4,6,2,8,3 pass 料 理 料 列 列 5,4,6,2,8,3 4,5,2,6,3,8 4,2,5,3,6,8 2,4,3,5,6,8 2,3,4,5,6,8 5,4,6,2,8,3 3,4,2,5,8,6 2,3,4,5,6,8 2,3,4,5,6,8 5,4,6,2,8,3 5,4,6,2,3,8 5,4,3,2,6,8 2,4,3,5,6,8 2,3,4,5,6,8 5,4,6,2,8,3 4,5,6,2,8,3 2,4,5,6,8,3 2,3,4,5,6,8 29 insertion sort selection sort quick sort heap sortrecursive 來 30 selection sort worst case 度 time complexity O(n log n) average case 度 time complexity O(n 2 ) best case 度 time complexity O(1) 不 unstable 31 18,10,31,20,27 立 3 B B-Tree of order 3 裂 31 裂 Root 兩 32 列 Oct Aug Dec Mar Sep 33 列 度 AVL Tree 度 1 n 度 O(log n) Insert Delete 度 O(log n) Search 度 O(log n) 34 Huffman 2,3,7,9,11 路 度 Weighted External Path Length 32 48 69 101

年 識 料 35 列 Internal Search 行 External Search 行 Static Search 料 不 Dynamic Search 料 36 列 索 Index 索 料 索 索 料不 索 錄 Record 數 料 錄數 37 列 DEAP Complete Binary Tree Root Left Subtree Min-Heap 度 O(log n) 38 Division 數 Hashing Function 數 數 便 Hash Table 率 Collision 不 39 利 Division 數 Hashing Function 12,33,125,78,64 7 bucket slot 0 6 若 Linear Probing 來 理 列 Collision 度 5/7 2 64 6 125 40 若 Min-Max Heap 3 1 2 3 4 41 列 special word Fortran keyword C keyword C++ reserved word keyword Jave special word 42 參數 不 列 數 數 邏 43 列 Prolog 不 Prolog The closed world assumption Prolog NOT operator logical NOT Prolog goal-driven 行 Prolog declarative semantics 44 Smalltalk method 列 不 variables message expressions block expressions exception parts 45 object class instance message class method 來 行 六

年 六 識 料 46 行 錄 列 料 狀 tree 列 queue stack graph 47 數 counter 行 參數 數 數 數 48 列 串 串 regular set {a i b j gcd(i,j)=1} {a n ba n n1} {L * L is a subset of 0 * } {a i b n c n i 1,n1} 49 列 Lisp 不 (cdr (cdr(a b c))) (c) (car (car((a b) b c))) a (atom? (car(a b))) F (null? (car(() b c))) T 50 scheme 列 不 (define (map f x) (cond ((null? x) ()) (else (cons (f (car x))(map f(cdr x)))) )) (map list (a b c)(1 2 3)) ((a 1)(b 2)(c 3)) (map car ((a 1)(b 2)(c 3)(d 4))) (a b c d) (map square (1 2 3 4 5)) (1 4 9 16 25) (map cdr ((a 1)(b 2)(c 3)(d 4))) (1 2 3 4) 51 C int *foo[20]; 列 foo foo foo 數 數 foo 20 數 foo 20 數 數 52 數 Type Compatibility 列 Name Equivalence Structure Equivalence Declaration Equivalence Dynamic Equivalence 53 了 行 率 了 array operation constructs 列 不 列 array operation APL Fortran 77 Fortran 90 Matlab 54 Java 列 C++ friend package applet thread class 55 Ada 95 C++ Java 列 留 不 來 subclass extend public protected subtype 56 C++ class 留 來 private properties class(es) public friend protected private 57 列 不 行 錄 return point global variable 參數 actual parameter 料 local data 58 out mode 參數 參數 actual parameter 數 constant 數 variable arithmetic expression 邏 logical expression 59 流 不 列 參數 60 行 call by name 參數 APL LISP ALGOL 60 FORTRAN

年 識 料 61 PASCAL 行 Program main Var x: integer; Procedure A(var x: integer); {call-by-address parameter} Begin x : = x + 10; End; Procedure B(x: integer); {call-by-value-in parameter} Begin A(x); x : =x+5; End; Begin {of main} x : = 5; B(x); Writeln(x) End. 5 10 15 20 62 若 Procedure B parameter call-by-address 5 10 15 20 63 列 Java language 例 理 exception handling 例 exception 類 class 例 static scoping 例 procedure calls 不 行 例 64 列 數 dynamic scoping Scheme ML LISP Haskell 65 列 compiled programs 行 率 execution efficiency interpreted programs compiled programs flexibilityinterpreted programs C Fortran 邏 Java assembly language 66 易 行 行 不易 漏洞 67 列 Java 數 Java 邏 Java Java assembly language 68 列 不 易 不易 漏洞 行 行 69 Java library 列 Thread class method main sleep suspend synchronized

年 識 料 70 不 數 Aliases 列 Fortran 77 Equivalence Aliases C++pointer Aliases Java 不 pointer 不 Aliases Aliases 參數 71 lost object 列 reclaim storage Reference Counting Approach Garbage Collection Mark & Sweep Method Locks-and-Keys method proposed in UW-Pascal 72 理 dangling pointer 列 ANSI C Tombstone Approach non-recursive program 理 73 C++ Inheritance super class private variable private inheritance private properties class(es) 74 列 C++ subclasses 都 subtypes class constructor method class destructor method 75 列 不 case multi-selector C ADA LISP PASCAL 76 FORTRAN 90 若 行 列 令 break change proceed continue 77 列 理 列 arrays 料 C++ APL PL/1 COBOL 78 列 數 (define (f3 n) (f3c n id)) (define (id n) n) (define (f3c n c) (if (= n 0) (c 1) (f3c (- n 1) (lambda (x) (c (* n x))) ))) 行 數 (f3 4) 4 10 24 64 79 列 axiomatic semantics 來 programming environments denotational semantics 來 operational sematics 來 數 理 邏 理 80 列 functional languages imperative languages 不 functional languages 行 度 functional languages functional languages functional languages concurrent execution 易