What is an Algorithm ? | Data Structures and Algorithms

Simple Snippets
Youtube
Related Topic
:- Data Structures

------ In this tutorial we will understand what is algorithm in computer science. The term algorithm is used many times in computer science especially in programming and data structures. Dictionary Definition : A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer. Formal Definition : An algorithm is a finite set of instructions that are carried in a specific order to perform specific task. Algorithms typically have the following characteristics – 1. Inputs : 0 or more input values. 2. Outputs : 1 or more than 1 output. 3. Unambiguity : clear and simple instructions. 4. Finiteness : Limited number of instructions. 5. Effectiveness : Each instruction has an impact on the overall process. Here is an example of an Algorithm in Programming - Write an algorithm to add two numbers entered by user. – Step 1: Start Step 2: Declare variables num1, num2 and sum. Step 3: Read values num1 and num2. Step 4: Add num1 and num2 and assign the result to sum.(sum←num1+num2 ) Step 5: Display sum Step 6: Stop 

Comments