# Analysis and design of algorithms

## Contents

- 1 definition of the algorithm
- 2 Terms of algorithm
- 3 How to analyze the algorithm
- 4 design algorithm 4.1 charts 4.2 Track 4.3 planned online and offline 4.4 way Obstreperousness
- 4.1 charts
- 4.2 Track
- 4.3 planned online and offline
- 4.4 way Obstreperousness
- 5 ways of writing the algorithm
- 6 The difference between the algorithm and program
- 7 References

## The algorithm definition

Called the multiplication tables and division old algorithms, and having advanced civilizations invented computers and associated algorithms by fully connected, it has been known after the algorithm as a set of steps that the person can access their way to a specific solution; Where address data and data algorithm, it should be noted here that this data is not limited to numbers and numbers, but more than that to include graphics, text, sounds, images, [1] In other, the algorithm is a list of rules and regulations that must be followed to solve a particular problem, it is worth mentioning that the arrangement and coordination which is very important; You can not reach the desired solution only by following the steps and instructions in the order in which they were received on it, [2] and may not repeat any step, or even ignore one of them. [1]

The first invented the concept of algorithms is the world famous sports Muslim Muhammad ibn Musa al-Khwarizmi. Khwarizmi lived in the city of Baghdad between 780-847m, and that was in the reign of Caliph Mamoun, it has emerged in mathematics and astronomy, and the most important sporting achievements put the principles of algebra, and written by his famous algebra and the interview, which took the word algebra to be translated into all the languages of the world, as presented another book in the account, the transfer to the Latin language titled (Algoritmi de nemero lndriun). [1]

## Terms of algorithm

Must be available in the algorithm set of conditions, are: [3]

- Input (Input): input must be zero, or more.
- Output (Output): output should be a value at least.
- Clarity (Definiteness): steps must be clear and unambiguous, even understood smoothly when people, for example, this statement: (Add 6 or 7 to x) is not clear K and thus they do not meet the conditions of the algorithm.
- Finitude (Finiteness): solve every step of the algorithm in advance of a certain time, for example, the following words: (dividing the number 10 to number 3 with high accuracy), is not limited, so they do not meet the conditions of the algorithm are not allowed to exist in the program.
- Mahloulih (Effectiveness): You must be every possible step solution, for example, is the following statement: (3/0) is an impossible solution, because it is the value of knowledge.

## How to analyze the algorithm

Analysis of the algorithm is known (in English: Algorithm Analysis) that determine the quality and efficiency of the algorithm, and then develop them better, and measured the extent and quality of the algorithm Anjazah two metrics, namely: [3]

- The complexity of the vacuum gauge (Space Complexity): is the amount of memory needed by the program (run it until its completion), this type and on two Yeni, namely: Section hard: is the independent section dedicated to simple and compound variables, constants and instructions. Section variable: This section consists of a vacuum that the program needs of the complex variables that size depends on the issue to be resolved.
- Section hard: is the independent section dedicated to simple and compound variables, constants and instructions.
- Section variable: This section consists of a vacuum that the program needs of the complex variables that size depends on the issue to be resolved.
- The complexities of time (Time complexity): is an amount of time required for the formation and the formation of a program until it ends, and consists of: (T (P) = Const + tp)

## The algorithm design

### Charts

Scheme known (in English: Graph) that a group of elements that reflect warheads (in English: Vertices); So that these elements are connected with each other relationships called edges (in English: Edges), and charts are divided into three types, namely: [3]

- Schema is not vector: is a scheme which are associated elements with each other in a non-arranged, so the marginalized trends.
- Vector diagram: is a scheme which are associated elements with each other within a certain pattern and order, and the trends Bhaz (stock) is necessary and very important.
- The joint scheme: is a chart that includes both previous types, it connects elements of what is destined to do some of which linked the relationship is heading.

### Track

A track is a set of connecting straight lines between two points in the chart, with the caveat that the track is not written within the group in parentheses, and the length of the path is the number of connecting lines between each two points in the chart, and calculates the length of the path by calculating the number of couples or the number of lines in planned, taking into account the presence of more than one path between points in the charts flying. [3]

### Planned online and offline

Caller scheme is a chart that contains paths between two points in the scheme, the scheme is not related to it is planned that contains some elements related to the (discrete). [3]

### Way Obstreperousness

This method works on solving examples of issues that are often Petkberha a particular thing or out of the same thing, as is the case in the win and loss, and these issues contain the following elements, namely: [3]

- Target (English Function: Objective Function); So that the solution within certain conditions and restrictions of the issue, and the best possible solutions proposed so-called best solution.
- Called Group B restrictions in English (Constraints), and the so-called solution that connects to the best objective function optimal solution.

## Methods of writing algorithm

Formulated the algorithm in several ways, so that these different ways in the simplicity of understanding and accuracy, and the most important of these methods as follows: [1]

- Formulation of natural language algorithm used daily: Through this method the order of the steps in the solution used daily; Whether this was the language is Arabic or English, and simple examples of this method is the following example:

Example: An algorithm that shows the steps to wake up from the moment of waking up from sleep until going to work: [1]

The solution:

In this example, notes that the order of the steps and do not dispense with any step is important for the implementation of the algorithm and complete.

- Formulation of the algorithm especially symbolic language: This method adopted on the basis of mathematical concepts, and the most important ways symbolic algorithms represent are the programming languages C ++ (in English: ++ C), and encoding mathematical concepts in several methods Kaloslob graph.
- Formulation of the algorithm graphically: This method built on engineering grounds, to be executed through geometric shapes, and flow charts are the charts of the most commonly used in the implementation of algorithms.

## The difference between the algorithm and program

There is a difference between the program and algorithm; In terms of theory Ctsabih, Valjuzmih check all the conditions that have been mentioned previously (five conditions), can be described by the algorithm several phrases as a language algorithm, flow charts, the program does not achieve the third condition, and described the program of computer language, hence the: [3]

The program develops several steps and stages, are: [3]

- Requirements characterization: through identification of inputs and outputs.
- Design: is the identification of key processes that apply to each graph structure, with the assumption of a hardware address operations.
- Analysis: is compared to algorithms that reached to resolve the same, depending on the specific standards for the selection of the best and finest among these algorithms, and what should be alert to is that the analysis is fit errors based on the complexities of storage, but for improving it addresses the problems and fit errors based on the results that appear in the last the program.
- Encryption: In this step is selected graphic representation, and then determine the procedures, and then written for each process, and then a complete copy of an integrated program.
- Ensure validity: This step involves three things, namely: Demonstrated Health: Before you use the program must prove authenticity. Test: is the process through which generate graphical models, and if there is something wrong, there must be a signal alert for it. Diagnosis of errors: is the process through which set the code errors sites, and correct ways appropriate.
- Demonstrated Health: Before you use the program must prove authenticity.
- Test: is the process through which generate graphical models, and if there is something wrong, there must be a signal alert for it.
- Diagnosis of errors: is the process through which set the code errors sites, and correct ways appropriate.

## References

- ^ A b c d t w. Ali Suleiman, the principles of algorithms, Andalus University of Medical Sciences: Syria, Page: 73-78. Adapted.
- ↑ "What is an algorithm?", www.bbc.co.uk, Retrieved 16-5-2018. Edited.
- ^ A b c h v w x d d. Hassan Tohme, Am Hind Shaaban, a researcher Hassan Kermash, analysis and design of algorithms, page: 5-10, 95-101. Adapted.

### Gorgeous!

### We regret it!

Successfully sent, thank you!