Daa Unit I
Daa Unit I
Unit I
Fundamentals
Note: Material for this Notes are taken from Internet and books and
only being used for students reference and not for commercial purpose
Chapter 1 Topics
• Algorithms
• Algorithms as a Technology
Algorithms
Goals:
Learn techniques of algorithm design and analysis so
that you can:
• develop algorithms,
• show that they give the correct answer, and
• understand their efficiency
Algorithms
What is an algorithm?
• 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. An algorithm is thus a sequence of
computational steps that transform the input into the
output. (CLRS, p. 5)
Algorithms
What is an algorithm?
• An algorithm is a tool for solving a well-specified
computational problem. The statement of the problem
specifies in general terms the desired input/output
relationship . The algorithm describes a specific
computational procedure for achieving that
input/output relationship. (CLRS, p. 5)
Algorithms
Space efficiency:
Note that space requirements set a minimum lower
bound on the time efficiency of the problem.
Suppose that our data structure is a single-dimensioned
array with n = 100 elements in it. Let’s say that the
first step in our algorithm is to execute a loop that just
copies values into each of the 100 elements. Then our
algorithm must take at least 100 iterations of the loop.
So the running time of our algorithm is at least O(n),
just from setting up (initializing) our data structure!
Algorithms as a Technology