Skip to content

Commit c4ec351

Browse files
Update README.md
1 parent 0c87f01 commit c4ec351

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@
66
<li><strong>Proper usage of resources:</strong>&nbsp;The right selection of an algorithm will ensure that a program consumes the least amount of&nbsp;<a href="https://en.wikipedia.org/wiki/Computer_memory" target="_blank" rel="nofollow noopener">memory</a>. Apart from memory, the algorithm can determine the amount of processing power that is needed by a program.</li>
77
</ul>
88
<p><strong>The algorithm for a child's morning routine could be the following:</strong></p>
9-
<p><strong>Step 1:&nbsp;</strong>Wake up and turn off alarm</p>
10-
<p><strong>Step 2:&nbsp;</strong>Get dressed</p>
11-
<p><strong>Step 3:&nbsp;</strong>Brush teeth</p>
12-
<p><strong>Step 4:&nbsp;</strong>Eat breakfast</p>
13-
<p><strong>Step 5:&nbsp;</strong>Go to school</p>
9+
<ul>
10+
<li><strong>Step 1:&nbsp;</strong>Wake up and turn off alarm</li>
11+
<li><strong>Step 2:&nbsp;</strong>Get dressed</li>
12+
<li><strong>Step 3:&nbsp;</strong>Brush teeth</li>
13+
<li><strong>Step 4:&nbsp;</strong>Eat breakfast</li>
14+
<li><strong>Step 5:&nbsp;</strong>Go to school</li>
15+
</ul>
1416
<p><strong>&nbsp;The algorithm to add two numbers entered by user would look something like this:</strong></p>
15-
<p><strong>Step 1:&nbsp;</strong>Start</p>
16-
<p><strong>Step 2:&nbsp;</strong>Declare variables num1, num2 and sum</p>
17-
<p><strong>Step 3:&nbsp;</strong>Read values num1 and num2</p>
18-
<p><strong>Step 4:&nbsp;</strong>Add num1 and num2 and assign the result to sum</p>
19-
<p><strong>&nbsp;sum &larr; num1 + num2</strong></p>
20-
<p><strong>&nbsp;Step 5:&nbsp;</strong>Display sum</p>
21-
<p><strong>Step 6:&nbsp;</strong>Stop</p>
17+
<ul>
18+
<li><strong>Step 1:&nbsp;</strong>Start</li>
19+
<li><strong>Step 2:&nbsp;</strong>Declare variables num1, num2 and sum</li>
20+
<li><strong>Step 3:&nbsp;</strong>Read values num1 and num2</li>
21+
<li><strong>Step 4:&nbsp;</strong>Add num1 and num2 and assign the result to sum</li>
22+
<li><strong>sum &larr; num1 + num2</strong></li>
23+
<li><strong>Step 5:&nbsp;</strong>Display sum</li>
24+
<li><strong>Step 6:&nbsp;</strong>Stop</li>
25+
</ul>
2226
<p><strong>&nbsp;</strong>Two of these algorithms accomplish exactly the same goal, but each algorithm does it in completely different way to achieve the required output or to accomplish our task. In computer programming, there are often many different ways &ndash; algorithms (any well-defined computational procedure that takes some value, or set of values, as&nbsp;<a href="https://en.wikipedia.org/wiki/Input_(computer_science)" target="_blank" rel="nofollow noopener">input</a>&nbsp;and produces some value, or set of values as&nbsp;<a href="https://en.wikipedia.org/wiki/Output" target="_blank" rel="nofollow noopener">output</a>) -- to accomplish any given task. Each algorithm has credits and demerits in different situations. If you have a million integer values between&nbsp;<strong>-2147483648</strong>&nbsp;and&nbsp;<strong>+2147483647</strong>&nbsp;and you need to sort them, the bin sort is the accurate algorithm to use. If you have a million book titles, the quick sort algorithm might be the best choice. By knowing the toughness and weaknesses of the different algorithms, you pick the best one to accomplish a specific task or to solve a specific problem.</p>
2327
<p>One of the most important aspects of an algorithm is how fast it can manipulate data in various ways, such as inserting a new data item, searching for a particular item or sorting an item. It is often easy to come up with a list of rules to follow in order to solve a problem, but if the algorithm is too slow, it's back to the drawing board.&nbsp;<a href="https://en.wikipedia.org/wiki/Algorithmic_efficiency" target="_blank" rel="nofollow noopener">Efficiency</a>&nbsp;of an algorithm depends on its design and implementation. Since every procedure or formula for solving a problem based on conducting a sequence of specified actions -- uses computer resources to run --&nbsp;<a href="https://en.wikipedia.org/wiki/Run_time_(program_lifecycle_phase)" target="_blank" rel="nofollow noopener">execution time</a>&nbsp;and internal memory usage are important considerations to analyze an algorithm.</p>
2428
<p><strong>Why Study Algorithms?</strong></p>

0 commit comments

Comments
 (0)