Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basics Prof. Hsin-Mu (Michael) Tsai (蔡欣穆)

Similar presentations


Presentation on theme: "Basics Prof. Hsin-Mu (Michael) Tsai (蔡欣穆)"— Presentation transcript:

1 Basics Prof. Hsin-Mu (Michael) Tsai (蔡欣穆)
Department of Computer Science and Information Engineering National Taiwan University

2 What is an algorithm? A computable set of steps to achieve a desired result. All algorithm must satisfy the following criteria: Input Output Definiteness Finiteness Effectiveness Input: there are zero or more quantities that are externally supplied. Output: At least one quantity is produced. Definiteness: each instruction is clear and unambiguous. Finiteness: if we trace out instructions of an algorithm, then for all cases, the algorithm terminates after a finite number of steps. Effectiveness: every instruction must be basic enough to be carried out, in principle, by a person using only pencil and paper. (must be feasible) data structure and algorithm I hsin-mu tsai, fall 2010

3 example Statement 1: “Is n=2 the largest value of n for which there exist positive integers x, y, and z such that 𝑥 𝑛 + 𝑦 𝑛 = 𝑧 𝑛 has a solution?” Statement 2: “Store 5 divided by zero into x and go to statement ㄆ.” Which criterion do they violate? Input Output Definiteness Finiteness Effectiveness data structure and algorithm I hsin-mu tsai, fall 2010


Download ppt "Basics Prof. Hsin-Mu (Michael) Tsai (蔡欣穆)"

Similar presentations


Ads by Google