ITM 207 Lecture 4: Lecture 4.docx
Document Summary
An algorithm is a collection of (processing) tasks to be executed in a specific order as a solution to a given problem. Highest mark algorithm: start, read the first mark, designate the first mark to the highest mark, read the next mark, write the highest mark, end. If newly read mark is greater than the highest mark, then make it the highest mark. If all marks are read then proceed to step 7 otherwise repeat step 4-6 in order. What is an algorithm: finite duration- end occurs within a finite time from start, three core elements: Input: processing, output, unambiguous statement of the solution encoding into a computer program is straightforward, deterministic (most algorithms)- for the same input, the algorithm generates the same output. Needs to have the same input for the same output. Algorithm refinement: start, mark read first mark, highestmark mark, mark raed next mark, write highestmark, end.