0% found this document useful (0 votes)
39 views3 pages

Algorithm

The document is a marking guide for an algorithm analysis and design test at the International University of East Africa. It covers topics such as definitions and characteristics of algorithms, running time, factors affecting it, and asymptotic growth types. Additionally, it includes pseudo code for analysis and examples to illustrate the concepts discussed.

Uploaded by

musamuhammed490
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
39 views3 pages

Algorithm

The document is a marking guide for an algorithm analysis and design test at the International University of East Africa. It covers topics such as definitions and characteristics of algorithms, running time, factors affecting it, and asymptotic growth types. Additionally, it includes pseudo code for analysis and examples to illustrate the concepts discussed.

Uploaded by

musamuhammed490
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
International University of East Africa Faculty of Science and Technology 82102: Algorithm Analysis and Design Tost 1: Marking Guide 11'* October 2013; Time 8:30- 10:00am 1. (a) What is an Algorithm? [2 marks] iv * An Algorithm is sequence of unambiguous instructions for solving a problem, i.e, for obtaining the required output for any legitimate input in a finite amount of time or * An algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output Jo) Explain the five characteristics of an Algorithm [5 marks] « Input: Zero or more quantities’ are externally supplied * Definiteness: Each instruction is clear and unambiguous * Finiteness: The algorithm terminates in a finite number of steps. « Effectiveness: Each instruction must be primitive and feasible © Output: At least one quantity is produced 2. (a) Define the term Running time of an algorithm [4 marks] a * The running time of an algorithm specifies the time the algorithm takes to produce an output. It is claculated by identifying and counting the basic operation(s) in the algorithm » Explain the factors that affect the running time of an algorithm, [8 marks] * speed of CPU, bus and peripheral hardware « design think time, programming time and debugging time « language used and coding efficiency of the programmer « quality of input (good, bad or average) 3. The size of inputs to an algorithm is governed by three factors, With an examples list, down these factors.[6 marks] the data representation, ¢.g. matrix * the operations of the algorithm, e.g. spell-checker © the properties of the objects in the problem, e.g. checking if a given integer is a prime number re os ‘ Z ¢ Consider the pseudo code given below. By counting the basic operation; what is the running time of the algorithm assuming that each basic operation takes a constant amount of time. [10 marks} 0.1 for int i=0; i =08&t< ale) 1 al) +a) = al): 1 all] 1 » 0 Step Count (ste) frequency

You might also like