Docsity

Algorithms and Program Development: A Comprehensive Approach, Essays (university) of Programming for Engineers

Partial preview of the text

Download Algorithms and Program Development: A Comprehensive Approach and more Essays (university) Programming for Engineers in PDF only on Docsity!

  • CLASS: PBIT
  • MSSV: BHBF

 CONTENT:

I.Introduction

  • Algorithms Give an example
  • Steps in program development
  • Applications of algorithms and programs solving
  • Coding II. Algorithm
  • Algorithms definition
  • Characteristics of algorithms
  • Types of algorithms III. Steps in program development
  • Program development life cycle o Defining the problem o Designing the program o Coding the program o Testing and Debugging the program o Documenting the program o Deploying and Maintaining the program IV. Applications of algorithms and problem solving
  • Examination
  • Data representation
  • Algorithms
  • Control structures
  • Implementation
  • Problems solving process

ALGORITHM

I. Algorithms definition

An algorithm is an effective step-by-step procedure for solving a problem in a finite number of steps. In other words, it is a finite set of well-defined instructions or step-by-step description of the procedure written in human readable language for solving a given problem.

EXAMPLE OF ALGORITHM: Step 1: Clean the skin for the purpose of removing dead skin, dirt, and oil ... These are the causes of acne. Skin does not absorb additional nutrients from cosmetic supplements. Use the right cleanser for your skin type for best results. Step 2: Moisturizing will make the skin healthy, elastic, and smooth. Moisturizing water provides adequate water and nutrients. Step 3: Protect skin with sunscreen. If you take care of the skin but forget this step, the skin will quickly age, darken and easily get other skin diseases.. Then, I will show you 3 steps to skincare:

III.Types of algorithms

There are some basic types of algorithms: o Swap numbers algorithm o Find min/max algorithm o Calculate sum algorithm o Search algorithm o Adding numbers algorithm Besides some basic types of algorithms, I will give some other types of them: 1.Recursive Algorithm

  1. Divide and Conquer Algorithm
  2. Dynamic Programming Algorithm
  3. Greedy Algorithm
  4. Brute Force Algorithm
  5. Backtracking Algorithm

Example of Swap Numbers Algorithm:

Example of Calculate Sum Algorithm:

Example of Search Algorithm:

Example of Recursive Algorithm:

Example of Divide and Conquer Algorithm:

Example of Greedy Algorithm:

Example of Brute Force Algorithm:

IV. Applications of Algorithms

As listed above, algorithms are extremely important and can be applied in different fields. From computer programming to scientific experiments, algorithms have found a vital place in several domains. Ideally, you can apply an algorithm flowchart in the following ways. In Computer Programming It doesn’t matter which programming language you are using, the first thing you need to solve a problem is by coming up with an algorithm. Even the most complex of problems can be resolved by working on an algorithm flowchart. Let’s consider that we have to write a program to automatically print numbers from 1 to 20. To do this, we initialize a variable and would perform an increment of 1 in every cycle. The cycle would be repeated till the number reaches 20.

In Mathematics and Scientific Calculations Just like programming, algorithms can also be used in solving mathematical or scientific problems. From printing the Fibonacci series to calculating the factorial of a number, you can come up with an algorithm for any math problem. In this example, you can see we have come up with an algorithm to convert Fahrenheit to Celsius. At first, we have taken the input from the user, applied the Fahrenheit to Celsius formula, and then would display the results.