Introduction to Algorithms

Introduction to Algorithms

Jan 04, 2023

1-What is an Algorithm ?

The word means “a process or set of rules to be followed in calculations or other problem-solving operations”. Therefore Algorithm refers to a set of rules/instructions that step-by-step define how a work is to be executed upon in order to get the expected results.

2-What are the Properties of an Algorithm?

  • Input : an algorithm should have some input

  • Output : at least one output should be returned by the algorithm after the completion of the specific task based on the given inputs.

  • Definiteness : Every statement of the algorithm should be unambiguous.

  • Finiteness : No infinite loop should be allowed in an algorithm.

3- Advantages & Disadvantages of algorithm:

  • 3.1 Advantages :

- It is easy to understand

- Algorithm is a step-wise representation of a solution to a given.

- 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.

  • 3.2-Disadvantages :

- Writing an Algorithm takes a long time so it is time-consuming .

- Branching and looping statements are difficult to show in algorithm.

4- How to design an algorithm :

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 solved by this algorithm.

4. The output to be expected when the problem the is solved.

5. The solution to this problem, in the given constraints.

5- Famous Algorithms :

1. Binary Search Algorithm

2. Linear Search Algorithm.

3. Depth First Search Algorithm

4. Quick Sort Algorithm.

5. Floyd Warshall Algorithm.

6. Brute-Force Algorithm.

References

1. [https://webeduclick.com/](https://webeduclick.com/)

2. [https://www.geeksforgeeks.org/](https://www.geeksforgeeks.org/)

3. [https://medium.com/](https://medium.com/)

4. [https://scholar.google.com/](https://scholar.google.com/)

Enjoy this post?

Buy Mohsen Ghalem a coffee