Professional Documents
Culture Documents
Algorithm
Algorithm
Submitted to:
Sir Shahzad Ali
Submitted by:
Roll:
Class:
Topic:
Algorithms
Question 1. Define Algorithm and Why algorithms are important?
Algorithms are the building blocks of computer programs. They are as important to
programming as recipes are to cooking. An algorithm is a well-defined procedure that takes
input and produces output. The main difference here is that algorithms are mathematical or
textual in nature.
Question 2. What is the difference between iterative and recursive structure of algorithms?
Explain with examples.
Answer: Recursive functions work through the process of calling themselves until a condition is
met whereas iteration uses a looping control structure in order to repeat a section of code until
a certain condition is met. For example ,while ,do while and for. The only
real difference IMO between them is compilation differences.
Answer: Efficiency:-
Correctness:-
Complexity:-