Presentation is loading. Please wait.

Presentation is loading. Please wait.

1. The Role of the Algorithms in Computer. 2 1.1 Algorithms – 1/2 Algorithm: Any well-defined computation procedure that takes some value, or set of values,

Similar presentations


Presentation on theme: "1. The Role of the Algorithms in Computer. 2 1.1 Algorithms – 1/2 Algorithm: Any well-defined computation procedure that takes some value, or set of values,"— Presentation transcript:

1 1. The Role of the Algorithms in Computer

2 2 1.1 Algorithms – 1/2 Algorithm: Any well-defined computation procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. Or: tool for solving well specific computational problem. Example: Sorting problem Input: A sequence of n numbers Output: A permutation of the input sequence such that.

3 3 Algorithms – 2/2 An instance of a problem consists of all inputs needed to compute a solution to the problem. An algorithm is said to be correct if for every input instance, it halts with the correct output. A correct algorithm solves the given computational problem. An incorrect algorithm might not halt at all on some input instance, or it might halt with other than the desired answer.

4 4 What kind of problem can be solved by algorithm? The Human Genome Project The Internet Applications Electronic Commerce with Public-key cryptography and digital signatures Manufacturing and other commercial settings – linear programming Shorted paths

5 5 Efficiency Insertion sort: c 1 n 2 Mergesort c 2 nlogn c 1 <c 2 Computer A runs 10 9 instructions/second Computer B runs 10 7 instructions/second Let c 1 =2, c 2 =50, run Insertion sort on Computer A, and run mergesort on Computer B When n = 10 6, 2000 seconds versus 100 seconds When n = 10 8, 2.3 days versus 20 minutes


Download ppt "1. The Role of the Algorithms in Computer. 2 1.1 Algorithms – 1/2 Algorithm: Any well-defined computation procedure that takes some value, or set of values,"

Similar presentations


Ads by Google