งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

CSC201 การวิเคราะห์และออกแบบขั้นตอนวิธี Analysis and Design of Algorithms Asst.Prof. Dr.Surasak Mungsing

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "CSC201 การวิเคราะห์และออกแบบขั้นตอนวิธี Analysis and Design of Algorithms Asst.Prof. Dr.Surasak Mungsing"— ใบสำเนางานนำเสนอ:

1

2 CSC201 การวิเคราะห์และออกแบบขั้นตอนวิธี Analysis and Design of Algorithms Asst.Prof. Dr.Surasak Mungsing Aug-141

3 1-Aug-142 Lecturer: Aaat.Prof. Dr.Surasak Mungsing Contact: 12 th Floor, Building 11 Office Hour: TBA CSC201 Analysis and Design of Algorithms

4 1-Aug-143 Course Description การวิเคราะห์ทางทฤษฎีของขั้นตอนวิธี การเลือกโครงสร้าง ข้อมูลที่เหมาะสม ขั้นตอนวิธีเรียกซ้ำ การวิเคราะห์ชั้นความ ซับซ้อน การเรียงลำดับและการค้นหา การวิเคราะห์ความ ต้องการของเนื้อที่และเวลาที่ต้องการของขั้นตอนวิธี การ คำนวณได้และการตัดสินใจได้ของปัญหาที่ยากต่อการแก้ไข เช่นที่พบในปัญญาประดิษฐ์ แนะนำขั้นตอนวิธีแบบขนาน

5 1-Aug-144 Objective  Understanding of theory and applications of algorithms for computer-based problem solving  Concept development for computer- based problem solving  Skill improvement for design of computer-based problem solving

6 1-Aug-145 ตำราและเอกสารประกอบการสอน Books Mark Allen Weiss. Data Structures and Algorithm Analysis in Java, International Edition. Addison- Wesley (www.cs.fiu.edu/~weiss )www.cs.fiu.edu/~weiss R.T.C. Lee, S.S. Tseng, R.C. Chang, Y.T. Tsai. Introduction to the Design and Analysis of Algorithms, A Strategic Approach. McGraw-Hill Education (Asia). 2005

7 1-Aug-146 Evaluation Final Exam 40 % Mid-Term Exam 20 % Quiz20 % H/W & Exercise10% Participation10 % Total 100 %

8 1-Aug-147 Grading ScoreGrade A 75-79B B 65-69C C 55-59D D 0-49F

9 Outline Complexity theory and necessary mathematical background Complexity theory and necessary mathematical background Algorithms and algorithm analysis Algorithms and algorithm analysis Time complexity of algorithms in form of Big-Oh Time complexity of algorithms in form of Big-Oh Time complexity Analysis of Algorithms using Time complexity Analysis of Algorithms using List, tack, and Queue data structures List, tack, and Queue data structures Week1-7Week1-7 Aug-148 Course Introduction and review of Data Structures Course Introduction and review of Data Structures Time complexity analysis of sorting algorithms (Part II) Time complexity analysis of sorting algorithms (Part II) Time complexity analysis of sorting algorithms (Part I) Time complexity analysis of sorting algorithms (Part I)

10 Outline(Cont.) Shortest Path and Minimum Spanning Tree Time complexity analysis for searching in graph Time complexity analysis for searching in graph Algorithm design using Greedy and Divide and Conquer techniques (e-Learning) Divide and Conquer techniques (e-Learning) Algorithm design using Algorithm design using Dynamic Progra mming, techniques (e-Learning) and Backtracking techniques (e-Learning) Week Week Aug-149 Applications of Decision Tree P and NP Problem (e-Learning) Analysis of Algorithms using Trees data structure Analysis of Algorithms using Trees data structure

11 1-Aug-1410 Mutual Agreement  Attendant checking for each lecture  Postpone lectures will informed at least 1 week in advance  Makeup class will be announced in next class  Late class is not more than 20 minutes, otherwise there will be no class and requires a makeup class  Class attendance must be at least 80% to be eligible for final examination  All documents can be downloaded at

12 1-Aug-1411 CSE221/NMT221/ICT221 การวิเคราะห์และออกแบบ ขั้นตอนวิธี

13 Review: Data Structures Aug-1412

14 The Class Chain next (datatype ChainNode) element (datatype Object) Use ChainNode abcde null firstNode size = number of elements

15 The Method get public Object get(int index) { checkIndex(index); // move to desired node ChainNode currentNode = firstNode; for (int i = 0; i < index; i++) currentNode = currentNode.next; return currentNode.element; } abcde null firstNode

16 Removing An Element remove(0) firstNode = firstNode.next; abcde null firstNode

17 remove(2) determine beforeNode and change pointer. beforeNode.next = beforeNode.next.next; beforeNode abcde null firstNode

18 One-Step add(0,’f’) newNode abcde null firstNode f firstNode = new ChainNode(‘f’, firstNode);

19 Two-Step add(3,’f’) beforeNode = firstNode.next.next; beforeNode.next = new ChainNode(‘f’, beforeNode.next); abcde null firstNode f newNode beforeNode c

20 Circular List abcde firstNode

21 Doubly Linked List abcde null firstNode null lastNode

22 Doubly Linked Circular List With Header Node abce headerNode d

23 Doubly Linked Circular List abcde firstNode

24 1-Aug Stacks  Linear list.  One end is called top.  Other end is called bottom.  Additions to and removals from the top end only.

25 1-Aug Stack Of Cups bottom top C A B D E F bottom top C A B D E Picture is really a stack of cups and saucers LIFO = last in first out. The first cup that is removed from a stack of cups is the Last one that was added to the stack. Other examples of LIFO lists in real life: stack of trays in a cafeteria; paper stack in a printer or copy machine; newspaper stack at a news stand.

26 1-Aug Checking Matching Parentheses  (((a+b)*c+d-e)/(f+g)-(h+j)*(k-l))/(m-n)  The result is pairs of position(u,v) where the open parenthesis at u is correctly matched with the close parenthesis at v (2,6) (1,13) (15,19) (21,25) (27,31) (0,32) (34,38)  (a+b))*((c+d)  (0,4)  The close parenthesis at position 5 does not have an open parenthesis as its pairs  (8,12)  the open parenthesis at position 7 does not have a close parenthesis as its pairs

27 1-Aug-1426 Tower of Hanoi ABC discs are to be moved from tower A to tower C on the condition that larger disc cannot be placed on top of the smaller one

28 1-Aug-1427 Towers Of Hanoi/Brahma  towers of Hanoi with 3 discs A BC 1 2 3

29 1-Aug-1428  towers of Hanoi with 3 discs A BC 1 2 3

30 1-Aug-1429  towers of Hanoi with 3 discs A BC 123

31 1-Aug-1430  towers of Hanoi with 3 discs A BC 12 3

32 1-Aug-1431  towers of Hanoi with 3 discs A BC 12 3

33 1-Aug-1432  towers of Hanoi with 3 discs A BC 123

34 1-Aug-1433 Towers Of Hanoi/Brahma  towers of Hanoi with 3 discs A BC 1 2 3

35 1-Aug-1434  towers of Hanoi with 3 discs A BC พำๆรพำห 7 moves

36 1-Aug-1435 Recursive Solution ABC 1  Towerof Hanoi with n > 0 discs to be moved from tower A to tower C with the help of tower B  Move n-1 discs from tower A to tower B with the help of tower C

37 1-Aug-1436 A BC 1  ย้ายแผ่นทองคำด้านบนจาก A ไปยัง C

38 1-Aug-1437 A BC 1  ย้ายแผ่นที่อยู่ด้ายบนจำนวน n-1 จาก B ไปยัง C โดยใช้ A ช่วย

39 1-Aug-1438 A BC 1  moves(n) = 0 เมื่อ n = 0  moves(n) = 2*moves(n-1) + 1 = 2 n -1 เมื่อ n > 0

40 1-Aug-1439 Moves required  moves(64) = 1.8 * (approximately) required  At the rate of a billion moves/second it would take 570 years to complete the task of moving 64 disks.  At the rate of 1 disk a minute (the disks are, after all, rather heavy), will take about 3.4 * years or 34,000,000,000,000 years

41 1-Aug-14 40

42 Queue at the bus station Bus Stop front rear

43 Queue at the bus station Bus Stop frontrear

44 Queue at the bus station Bus Stop front rear

45 Queue at the bus station Bus Stop front rear

46 Queue implemented with array  Use 1-dimentional array to represent a queue queue [] Can be viewed as a circular queue [0] [1] [2][3] [4] [5]

47 Add an element into queue [0] [1] [2][3] [4] [5] AB C front rear Requires two pointers, front and rear

48 Add an element into queue move rear pointer clockwise 1 position [0] [1] [2][3] [4] [5] AB C front rear then assign a value to the array pointed by the rear pointer D queue[rear]

49 Current queue status [0] [1] [2][3] [4] [5] AB C front rear

50 Remove an element from queue [0] [1] [2][3] [4] [5] AB C front rear Move front pointer clockwise 1 position then move the value out from queue queue[front]

51 [0] [1] [2][3] [4] [5] AB C front rear Empty the queue

52 [0] [1] [2][3] [4] [5] B C front rear Empty the queue

53 [0] [1] [2][3] [4] [5] C front rear Empty the queue

54  Continuously remove elements from queue causes the queue to be empty  front = rear.  The queue is also empty when created  Starts with front = rear = 0. [0] [1] [2][3] [4] [5] front rear

55 [0] [1] [2][3] [4] [5] AB C front rear Make the queue full By keep adding an element to the queue

56 [0] [1] [2][3] [4] [5] AB C front rear D Make the queue full By keep adding an element to the queue

57 [0] [1] [2][3] [4] [5] AB C front rear DE Make the queue full By keep adding an element to the queue

58 [0] [1] [2][3] [4] [5] AB C front rear DE F When continuously adding elements to queue, it is finally full so front = rear. How do you know whether the queue is empty or full when front = rear ? Make the queue full By keep adding an element to the queue

59 How do we know whether the queue is empty or full when front = rear ?  Assign a variable, size, to keep number of element in queue  Increase queue size by 1 each time when when adding an element to queue (size++)  Reduce queue size by 1 each time when remove an element from queue (size--)  Queue is empty when queue size = 0 (size=0)

60 1-Aug-1459 Tree in computer science leaves root nodes branches Tree is a set with at least 1 member t one of the tree member is called “root” other members(if any) are subtree(s)

61 1-Aug-1460 Binary Tree  is a tree that may be an empty tree (a tree with no member)  A non-empty binary tree has “root “  Remaining member (if any) สมาชิกที่เหลือ(ถ้ามี) จะแบ่งเป็นเป็น may be the root 0f at most 2 binary subtrees, called Left sub-tree and Right sub-tree

62 1-Aug-1461 An expression implemented by a binary tree (a + b) * (c – d) / (e + f) / + a b - c d + e f * /

63 1-Aug-14 62


ดาวน์โหลด ppt CSC201 การวิเคราะห์และออกแบบขั้นตอนวิธี Analysis and Design of Algorithms Asst.Prof. Dr.Surasak Mungsing

งานนำเสนอที่คล้ายกัน


Ads by Google