CHAPTER #01

Q1.Define an algorithm and explain the role of the algorithm in problem-solving.

ANS: Algorithm

The algorithm is a well-defined list of steps for solving a particular problem. Informally, an algorithm is a well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of value, as output. An algorithm is thus the sequence of computational steps that transform the input into the output.

We can also view an algorithm as a tool for solving a well-specified computational problem.

Role of the algorithm in problem-solving

An algorithm plays an important role in developing solutions to a problem. For example, if we have a complex situation that requires a lot of information to be gathered and a lot of data to be processed.

Then by dividing each activity of this information gathering and data processing into steps will make the problem solving an easy task.” Dividing and Rule” is a very famous rule that makes the problem solving each task.

For intendance lot, we take an example of finding the average of 20 numbers. If this process is defined in small discrete steps then we can make the solution very easily.

An algorithm is a set of step-by-step procedures that provide the correct answer to a particular problem. … While often thought of as a purely mathematical term, the same kind of process can be followed to find the right answer when solving a problem or making a decision.

1. Select any 20 numbers.
3. Divide the result of step 2 by total no of observations i.e. 20.
4. The average will be calculated.

Q2.describe the criteria for measuring the efficiency of an algorithm on the basis of:

1. Inputs needed
2. Processing to be completed
3. Decision to be taken
4. Outputs to be provided

ANS. Criteria for measuring the efficiency of an algorithm

In computer science, efficiency is used to describe the properties of an algorithm relating to how much of various types of resources it consumes.

The two most frequently encountered and measurable metrics of an algorithm are:

• Speed or running time: the time it takes for an algorithm to complete and
• Space’– the memory used by the algorithm during its operation.

Furthermore, its efficiency can be measured on the basis of the following factors.

Scroll to Top