人事请假系统.pptVIP

  • 25
  • 0
  • 约1.02万字
  • 约 43页
  • 2018-04-30 发布于河南
  • 举报
人事请假系统

Advance Data Structure Review of Chapter 1 張啟中 Chapter 1 Basic Concepts 1.1 Overview: System Life Cycle 1.2 Algorithm Specification 1.3 Data Abstraction (Chapter 2) 1.4 Performance Analysis and Measurement System Life Cycle Example Algorithm Specification 演算法是由一序列的指令所組成。依序執行這些指令可以解決給定的問題。演算法具有下列五大條件: 輸入(Input) 外界可提供零個或多個輸入資料。 輸出(Output) 必須最少有一個輸出的結果。 明確性(Definiteness) 每一個指令的功能都必須明確而不混淆。 有限性(Finiteness) 對任意的輸入資料,演算法必須在有限的時間內執行完成。 有效性(Effectiveness) 每一個指令必須非常基本:僅用紙筆即可完成。 Algorithm Describing Natural language English, Chinese Instructions must be definite and effectiveness Graphic representation Flowchart work well only if the algorithm is small and simple Pseudo language Readable Instructions must be definite and effectiveness Combining English and C In this text Example Example Performance Analysis and Measurement Criteria Is it correct? Is it readable? … Performance Analysis (machine independent) Space complexity: storage requirement Time complexity: computing time Performance Measurement (machine dependent) Performance Analysis: Space complexity S(P)=C+SP(I) Fixed Space Requirements (C) Independent of the characteristics of the inputs and outputs instruction space space for simple variables, fixed-size structured variable, constants Variable Space Requirements (SP(I)) depend on the instance characteristic I number, size, values of inputs and outputs associated with I recursive stack space, formal parameters, local variables, return address Example Example *Program 1.11: Recursive function for summing a list of numbers (p.20) float rsum(float list[ ], int n) { if (n) return rsum(list, n-1) + list[n-1]; return 0; } Performance Analysis: Time Complexity? Compile time (C) independent of instance characteristics run (execution) time TP Running Time(執行時間) Program Step Definition The running time of an algorithm on a particular input is the number of primitive operations or “step” executed. It is convenient to define the notion of step so that it is machine-i

文档评论(0)

1亿VIP精品文档

相关文档