Understanding Algorithms in Computer Science.


Yashicavashishtha1065

Uploaded on May 31, 2021

Category Education

PPT on Understanding Algorithms in Computer Science.

Category Education

Comments

                     

Understanding Algorithms in Computer Science.

UNDERSTANDING ALGORITHMS IN COMPUTER SCIENCE Introduction • An algorithm is simply a set of steps used to complete a specific task. They're the building blocks for programming, and they allow things like computers, smartphones, and websites to function and make decisions. Source: edu.gcfglobal.org How it works? • All of these algorithms are built right in to the app's code. If there were any kind of error in the code, the app wouldn't be able to follow these algorithms correctly, meaning you wouldn't receive your directions. Source: edu.gcfglobal.org Example • It can be understood by taking an example of cooking a new recipe. To cook a new recipe, one reads the instructions and steps and execute them one by one, in the given sequence. The result thus obtained is the new dish cooked perfectly. • Similarly, algorithms help to do a task in programming to get the expected output. Source: www.geeksforgeeks.org Characteristics of an Algorithm • Clear and Unambiguous: Algorithm should be clear and unambiguous. Each of its steps should be clear in all aspects and must lead to only one meaning. • Well-Defined Inputs: If an algorithm says to take inputs, it should be well-defined inputs. • Well-Defined Outputs: The algorithm must clearly define what output will be yielded and it should be well-defined as well. Source: www.geeksforgeeks.org Characteristics of an Algorithm Cont. • Finite-ness: The algorithm must be finite, i.e. it should not end up in an infinite loops or similar. • Feasible: The algorithm must be simple, generic and practical, such that it can be executed upon will the available resources. It must not contain some future technology, or anything. • Language Independent: The Algorithm designed must be language-independent. Source: www.geeksforgeeks.org Advantages of Algorithms • It is easy to understand. • Algorithm is a step-wise representation of a solution to a given problem. • In Algorithm the problem is broken down into smaller pieces or steps hence, it is easier for the programmer to convert it into an actual program. Source: www.geeksforgeeks.org Disadvantages of Algorithms • Writing an algorithm takes a long time so it is time-consuming. • Branching and Looping statements are difficult to show in Algorithms. Source: www.geeksforgeeks.org Parameter to consider 1. The problem that is to be solved by this algorithm. 2. The constraints of the problem that must be considered while solving the problem. 3. The input to be taken to solve the problem. 4. The output to be expected when the problem the is solved. 5. The solution to this problem, in the given constraints. Source: www.geeksforgeeks.org Steps to design an algorithm 1. Step 1: Fulfilling the pre-requisites 2. Step 2: Designing the algorithm 3. Step 3: Testing the algorithm by implementing it Source: www.geeksforgeeks.org THANK YOU