You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class="fas fa-arrow-left "></i> Back to Index</a></button>
77
73
</div>
78
74
<divclass="wrapper">
79
-
<h1>What is an Algorithm?</h1>
75
+
<h2>What is an Algorithm?</h2>
80
76
81
77
82
78
<p>An algorithm is a set of well-defined instructions in sequence to solve a problem.</p>
83
79
84
80
<hr/>
85
-
<h2>Qualities of a good algorithm</h2>
81
+
<h3>Qualities of a good algorithm</h3>
86
82
87
83
<ol>
88
84
<li>Input and output should be defined precisely.</li>
89
85
<li>Each step in the algorithm should be clear and unambiguous.</li>
90
86
<li>Algorithms should be most effective among many different ways to solve a problem.</li>
91
-
<li>An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a
92
-
way
93
-
that it can be used in different programming languages.</li>
87
+
<li>An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.</li>
94
88
</ol>
95
89
96
90
<hr/>
97
-
<h2>Algorithm Examples</h2>
91
+
<h3>Algorithm Examples</h3>
98
92
99
93
<p><ahref="#add">Algorithm to add two numbers</a></p>
100
94
@@ -109,11 +103,11 @@ <h2>Algorithm Examples</h2>
109
103
<p><ahref="#fab">Algorithm of Fibonacci series</a></p>
110
104
111
105
<hr/>
112
-
<h2>Examples Of Algorithms In Programming</h2>
106
+
<h3>Examples Of Algorithms In Programming</h3>
113
107
114
108
<pid="add"><strong>Write an algorithm to add two numbers entered by the user.</strong></p>
115
109
116
-
<pre>
110
+
<pre>
117
111
Step 1: Start
118
112
Step 2: Declare variables num1, num2 and sum.
119
113
Step 3: Read values num1 and num2.
@@ -122,11 +116,11 @@ <h2>Examples Of Algorithms In Programming</h2>
122
116
Step 5: Display sum
123
117
Step 6: Stop
124
118
</pre>
125
-
<pid="largest"><strong>Write an algorithm to find the largest among three different numbers entered by
119
+
<pid="largest"><strong>Write an algorithm to find the largest among three different numbers entered by
126
120
the
127
121
user.</strong></p>
128
122
129
-
<pre>
123
+
<pre>
130
124
Step 1: Start
131
125
Step 2: Declare variables a,b and c.
132
126
Step 3: Read variables a,b and c.
@@ -143,10 +137,10 @@ <h2>Examples Of Algorithms In Programming</h2>
143
137
Step 5: Stop
144
138
</pre>
145
139
146
-
<pid="quadratic"><strong>Write an algorithm to find all roots of a quadratic equation
140
+
<pid="quadratic"><strong>Write an algorithm to find all roots of a quadratic equation
0 commit comments