Algorithm

An algorithm is a precise specification of sequence of instruction for solving a problem in finite number of steps. The algorithm must be written in human understandable form and each step or instruction must tell the reader what task is to be done clearly. Some of the characteristics of algorithm are input, effectiveness, finiteness, robustness, simplicity, correctness and output. Algorithms are never designed to bolster a specific programming code. As we know that all programming languages share the basic code builds like loops (do, for, while), flow-control (if-else) and so forth. So, these normal constructs can be utilized to design an algorithm. Algorithm validation is the process of measuring the effectiveness of an algorithm before it is coded to know that the algorithm is correct for every possible input. Analysis of algorithms is a branch of computer science that studies the performance of algorithms, especially their run time and space requirements. For algorithm testing, we take an input, calculate by hand the expected output, and compare it to the output that the algorithm provides us. If the outputs are same by calculating manually and by using the algorithm, then we can confirm that the algorithm is true or efficient and that it can be used for further processing. A sub-algorithm is a complete and autonomously characterized algorithmic module in a data structure. There are two sub-algorithms: function sub-algorithm and procedure sub-algorithm.

Summary

An algorithm is a precise specification of sequence of instruction for solving a problem in finite number of steps. The algorithm must be written in human understandable form and each step or instruction must tell the reader what task is to be done clearly. Some of the characteristics of algorithm are input, effectiveness, finiteness, robustness, simplicity, correctness and output. Algorithms are never designed to bolster a specific programming code. As we know that all programming languages share the basic code builds like loops (do, for, while), flow-control (if-else) and so forth. So, these normal constructs can be utilized to design an algorithm. Algorithm validation is the process of measuring the effectiveness of an algorithm before it is coded to know that the algorithm is correct for every possible input. Analysis of algorithms is a branch of computer science that studies the performance of algorithms, especially their run time and space requirements. For algorithm testing, we take an input, calculate by hand the expected output, and compare it to the output that the algorithm provides us. If the outputs are same by calculating manually and by using the algorithm, then we can confirm that the algorithm is true or efficient and that it can be used for further processing. A sub-algorithm is a complete and autonomously characterized algorithmic module in a data structure. There are two sub-algorithms: function sub-algorithm and procedure sub-algorithm.

Things to Remember

  • An algorithm is a precise specification of sequence of instruction for solving a problem in finite number of steps.
  • The algorithm must be written in human understandable form and each step or instruction must tell the reader what task is to be done clearly.
  • Some of the characteristics of algorithm are input, effectiveness, finiteness, robustness, simplicity, correctness and output.
  • Algorithms are never designed to bolster a specific programming code.
  • As we know that all programming languages share the basic code builds like loops (do, for, while), flow-control (if-else) and so forth. So, these normal constructs can be utilized to design an algorithm.
  • Algorithm designing is a procedure and is executed after the issue area is very much characterized i.e. we ought to know the issue area, for which we are designing an answer.
  • Algorithm validation is the process of measuring the effectiveness of an algorithm before it is coded to know that the algorithm is correct for every possible input.
  • Analysis of algorithms is a branch of computer science that studies the performance of algorithms, especially their run time and space requirements.
  • The main objective of analysis of algorithm is to anticipate the performance of various algorithms in order to guide the design choices.
  • For algorithm testing, we take an input, calculate by hand the expected output, and compare it to the output that the algorithm provides us. If the outputs are same by calculating manually and by using the algorithm, then we can confirm that the algorithm is true or efficient and that it can be used for further processing.
  • A sub-algorithm is a complete and autonomously characterized algorithmic module in a data structure.
  • There are two sub-algorithms: function sub-algorithm and procedure sub-algorithm.
  • The function sub-algorithm is called as an expression or as a variable and returns a single value through ‘return’ statements to the calling algorithm.
  • The procedure sub-algorithms is called by the ‘call’ statement in algorithms and it can return more than one value through parameters.

MCQs

No MCQs found.

Subjective Questions

Q1:

Find the area of the given figure.


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Here,<br />area of two rectangles = l&nbsp;&times; b&nbsp;<br />= 20 cm&nbsp;&times; 15 cm<br />= 300 cm<sup>2</sup><br />Also,<br />area of two triangles = 2 (\(\frac{1}{2}\)&nbsp;&times;b&nbsp;&times; h)&nbsp;<br />= 2 &times;&nbsp;\(\frac{1}{2}\)&nbsp;&times; 15&nbsp;&times; 10 cm<sup>2<br /></sup>= 150 cm<sup>2</sup><br />Again,<br />&there4; Area of the figure = 300 cm<sup>2</sup> + 150 cm<sup>2</sup><br />= 450 cm<sup>2</sup></p>

Q2:

Find the area of the given figure.



Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Area of the rectangle = l&nbsp;&times; b&nbsp;<br />= 20 cm&nbsp;&times; 15 cm&nbsp;<br />= 300 cm<sup>2</sup><br />Radius of each semi-circle = \(\frac{14}{2}\)&nbsp;<br />= 7 cm<br />Area of two semi-circles = 2(\(\frac{1}{2}\)&pi;r<sup>2</sup>)<br />= \(\frac{22}{7}\)&nbsp;&times; 7&nbsp;&times; 7 cm<sup>2</sup>&nbsp;<br />&nbsp;<br />= 154 cm<sup>2</sup><br />&there4; Area of the figure = 350 cm<sup>2</sup> + 154 cm<sup>2&nbsp;<br /></sup>= 504 cm<sup>2</sup></p>

Q3:

 Find the area of the shaded region in the given figure.

 


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Here,<br />Area of parallelogram = b&nbsp;&times; h&nbsp;<br />= 16 cm&nbsp;&times; 10cm&nbsp;<br />= 160 cm<sup>2</sup><br />Area of triangle = \(\frac{1}{2}\) b&nbsp;&times; h&nbsp;<br />= \(\frac{1}{2}\)&nbsp;&times; 16 cm&nbsp;&times; 10 cm<br />= 80 cm<sup>2</sup><br />&there4; Area of the shaded region = Area of parallelogram -Area of triangle<br />= 160 cm<sup>2</sup> - 80 cm<sup>2</sup><br />= 80 cm<sup>2</sup></p>

Q4:

 

Find the area of the shaded regions in the given figures.


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Area of rectangle = l&nbsp;&times; b&nbsp;<br />= 12 cm&nbsp;&times; 9 cm<br />= 108 cm<sup>2</sup><br />Area of parallelogram = b&nbsp;&times; h&nbsp;<br />= 6 cm&nbsp;&times; 4 cm<br />= 24 cm<sup>2</sup>&nbsp;<br />&there4; Area of the shaded region = Area of rectangle - Area of parallelogram<br />= 108 cm<sup>2</sup> - 24 cm<sup>2</sup>&nbsp; &nbsp; &nbsp;<br />= 84 cm<sup>2</sup></p>

Q5:

 

Find the area of shaded regions in the given figure.


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Here,<br />Area of bigger rectangle = l&nbsp;&times; b&nbsp;<br />= 20 cm&nbsp;&times; 16 cm&nbsp;<br />= 320 cm<sup>2</sup><br />Area of smaller rectangle = l&nbsp;&times; b&nbsp;<br />= 14 cm&nbsp;&times; 10 cm&nbsp;<br />= 140cm<sup>2</sup>&nbsp;<br />&there4; Area of the shaded region = Area of bigger recatngle - Area of smaller rectangle&nbsp;<br />= 320 cm2 - 140 cm<sup>2</sup>&nbsp;<br />= 180 cm<sup>2</sup></p>

Q6:

The perimeter of a square field is 96 m. Find its length.


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>The perimeter of the square field = 96 m<br />or, 4 l = 96 m<br />or, l = \(\frac{96}{4}\)&nbsp;<br />or, l = 24 m<br />&there4; The length of the field (l) = 24m&nbsp;</p>

Q7:

A rectangular room is twice as long as its breadth and its perimeter is 48 m. Find its length and breadth and area.


Type: Long Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Let, the breadth (b) pf the room be x m.<br />So, the length (l) of the room will be 2x m.<br />Now,<br />The perimeter of the rectangular room = 48 m<br />or, 2 (l + b) = 48 m<br />or, 2 (2x + x) = 48 m<br />or, 6x &nbsp;= 48 m<br />or, x = \(\frac{48}{6}\) m<br />or, x = 8 m<br />&there4; The breadth of the room (b) = x = 8 m<br />The length of the room (l) = 2x <br />= 2&nbsp;&times; 8m&nbsp;<br />= 16 m<br />Again.&nbsp;<br />Area of the room = l&nbsp;&nbsp;&times; b<br />= 16 m&nbsp;&times; 8 m<br />= &nbsp;128 m<sup>2</sup><sup></sup><br /><sup>&there4; Thw area of a room is 128 m2</sup><br /><br /></p>
<p>&nbsp;</p>

Q8:

If the perimeter of a circular ground is 220 m, find its radius and area.


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Solution:</p>
<p>Here,<br />The perimeter of circular ground = 220 m<br />or, 2&pi;r = 220 m<br />or, 2&nbsp;&times; \(\frac{22}{7}\)&nbsp;&times; r = 220 m<br />or, r = \(\frac{220 &times; 7}{2&nbsp;&times; 22}\) m<br />or, r = 35 m<br />Now,<br />Area of the circular ground =&nbsp;&pi;r<sup>2</sup><br />= \(\frac{22}{7}\)&nbsp;&times; 35 m&nbsp;&times; 35 m<br />= 3850 m<sup>2</sup>&nbsp;<br /><br /></p>

Videos

Areas of Plane Figures
Perimeter and Area- Plane figures - Maths - Class 7
Algorithm

Algorithm

Algorithms

An algorithm is a precise specification of a sequence of instruction for solving a problem in a finite number of steps. The algorithm must be written in the human understandable form and each step or instruction must tell the reader what task is to be done clearly. It must be written independently of any programming language. Some of the characteristics of algorithm are mentioned below:

  • Input: Every algorithm accepts an input or set of inputs and process them to get the result.
  • Effectiveness: It must process the input in the correct manner for solving the problem.
  • Finiteness: It must terminate after a finite number of steps.
  • Robustness: Must be clearly written to understand and must have an unambiguous meaning.
  • Simplicity: It must be as simple as possible.
  • Correctness: It must produce the same output for same sets of input.
  • Output: It must generate some sort of output.

Design of Algorithm

Algorithms are never designed to bolster a specific programming code. As we know that all programming languages share the basic code builds like loops (do, for, while), flow-control (if-else) and so forth. So, these normal constructs can be utilized to design an algorithm. We generally design algorithms in a number of steps. Algorithm designing is a procedure and is executed after the issue area is very much characterized i.e. we ought to know the issue area, for which we are designing an answer. An algorithm to add two numbers and display the result is given below:

step 1 − START ADD

step 2 − get values of a & b

step 3 − c ← a + b

step 4 − display c

step 5 – STOP

A problem can be solved in multiple ways, so we need to analyse the algorithms and select the best one for implementation.

Algorithm Validation

Algorithm validation is the process of measuring the effectiveness of an algorithm before it is coded to know that the algorithm is correct for every possible input. Providing a theoretical validation may not be possible in all cases. Alternatively, algorithm segments that have been validated or proved elsewhere can be used and the overall testing algorithm may be empirically validated for several test cases.

Analysis of Algorithm

Analysis of algorithms is a branch of computer science that studies the performance of algorithms, especially their run time and space requirements (Wikipedia, n.d.). The main objective of analysis of algorithm is to anticipate the performance of various algorithms in order to guide the design choices.

Algorithm Testing

For algorithm testing, we take an input, calculate by hand the expected output, and compare it to the output that the algorithm provides us. If the outputs are same by calculating manually and by using the algorithm, then we can confirm that the algorithm is true or efficient and that it can be used for further processing.

Sub-algorithm

A sub-algorithm is a complete and autonomously characterized algorithmic module in a data structure. It is called by the main algorithm and by some other sub-algorithm. It can get values from the calling algorithm. The syntax is:

name ( p1, p3, . . . . . . .. . . , pn )

{

body of sub - algorithm

}

where ‘name’ denotes the name of the sub-algorithm and ‘p1’, ‘p2’, ‘pn’ represents the parameters or arguments.

There are two sub-algorithms: function sub-algorithm and procedure sub-algorithm. The function sub-algorithm is called as an expression or as a variable and returns a single value through ‘return’ statements to the calling algorithm. The value returned by a sub-algorithm is used in an expression. The procedure sub-algorithms is called by the ‘call’ statement in algorithms and it can return more than one value through parameters.

References

(n.d.). Retrieved from Wikipedia: http://en.wikipedia.org/wiki/Analysis_of_algorithms.

Lesson

Algorithm

Subject

Data Structure and Algorithm

Grade

IT

Recent Notes

No recent notes.

Related Notes

No related notes.