Min menu

Pages

Recent Post's

What is Algorithms andAlgorithms typs



Definition of algorithm:

 Algorithm is considered one of the most important sciences in the branch of informatics and was founded by the Muslim scholar Muhammad bin Musa al-Khwarizmi. Algorithms search for solutions to specific issues in informatics in order to convert them into programs, and they also search for finding the best solution in the event of multiple solutions and he has known  Scientist Knuth algorithm in his book "The Art of Programming" as a set of rules that are characterized by the following characteristics:


 This group must be finished and end after a finite number of instructions It must be specific and precise in the sense that all must be described without confusion.  For there to be a result (at least one) that must be effective, that is, that all operations should be executable and in time completed by someone who uses manual capabilities.



 The circle (ellipse) to define the beginning and end of the algorithm Rectangle Operations (implementation == Methods for expressing the algorithm ==


 There are several ways to express the algorithm, including graphical (diagrams), including textual (phrases), and we will talk about graphical methods only. The graphical method for formulating algorithms depends on clarifying the steps of implementing the algorithm using special geometric shapes and arrows that connect between them in addition to natural language phrases and mathematical expressions.  Or boolean.  Thus, we get what is called a flowchart diagram, and we note here that the arrows detail the processes needed to complete the work and show their sequence. The flow chart uses agreed geometric shapes, each of which is designated for a type of operation.

Algorithms in Computer Science


 Algorithms in computer science or computer science are necessary for computers to operationalize programs and manage data in a practical way.  Many computer programs contain algorithms that detail specific computer instructions that should be performed in a specific order to carry out a specific task, such as calculating employee salaries or printing student reports and certificates.  Thus algorithms are a sequence of operations that are specified for a computer in order to perform them in a specific order.  Usually, when an algorithm is associated with processing information in a computer, the data is read from the input source, written to the output device, and / or stored for further processing at a later time.  The stored data is part of the internal state of the entity or system performing the algorithm.


 In practice, the algorithm is stored in one or more program data structures.


 From a mathematical operations perspective, an algorithm can be precisely defined as a set of specific operations and methods that are applied in all possible conditions that can arise.  Any conditional steps must be dealt with systematically, and each case separately, so that the criteria for each case are clear and carefully calculated.


 An algorithm is an accurate list of specific instructions and steps in a particular computational arrangement which is critical for the algorithm to always perform correctly.  It is usually assumed that these instructions are explicitly listed, and are described by the controls as starting at the top and flowing downwards.  Algorithms have been described in computer science as being a programmatic construct of a commanding nature, that is, they are commands directed to the computer in the form of “if such-and-such,” and this is the most common concept of algorithms, with the addition of some specific descriptions and conditions for carrying out each task.


 There are also other concepts that suit certain types of algorithms according to their tasks.

Basic compositions in algorithms


 Originally, the meaning of the algorithm was limited to only three structures, which are the basic structures that are represented by sequencing, selection, and / or iteration.


 It has been proven that algorithms do not need additional combinations other than these combinations. The use of these combinations facilitates the understanding of the algorithm and the discovery, change and correction of the errors contained in it.


 Here is a brief description of these three structures:


 1. Sequencing


 An algorithm is a set of sequential instructions, and these instructions are either simple or of the other two types (2, 3).


 2. Choice


 Some problems cannot be solved with a simple instruction sequence, and you may need to test some conditions and look at the test result.


 If the result is correct, follow a path containing concatenated instructions.


 If the result is wrong, follow a different course of instruction.


 This method is called decision-making or selection.


 3. Repetition


 Sometimes, when trying to solve some problems, it may be necessary to repeat the same sequence of steps a number of times until the desired solution is reached.

Explain how algorithms work


 In order to explain and simplify the concept of an algorithm and how it works, we assume that we have a set of positive integers that start with the number (1) and end with the number (200).


 The numbers are as follows:


 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20


 Assume that what is required is to know the number that represents an answer to a particular question.


 For example, if we assume that it is a game between two people, and the first person identifies a number in his mind from among these numbers, and asks the second person to know this number by guessing method, and the first person responds in every attempt and clarifies whether the guess is correct or wrong.


 In case of wrong guessing, he determines the location of the correct number and whether:


 Greater than or less than guesswork


 The regular solution


 The origin of this issue is that the second person may randomly guess the number that the first person chose in his mind, and he may continue to repeat the attempts until he guesses the correct number.  The maximum number of attempts in this case is (20) attempts if he was unlucky in (19) attempts and the correct guess is on the last attempt.  Or if he started guessing in an ascending sequence starting with number (1) and the correct answer is number (20).


 Algorithmic solution


 In the event that the correct number is located after each guess, in that it is greater than or less than the aforementioned guess, then it is possible to reach the correct solution after (5) attempts at most.


 And this experiment can be practically done to verify this.


 The summary of what the human mind does, in this simplified example, is precisely what the algorithm does in its simplest form.  When the second person makes the guess every time and the response is that his answer is wrong and that the correct number is greater than (or less) than the guess, his mind deletes the guess with all the numbers smaller than it (or greater than it), and start over to guess a number of the remaining numbers  , And so on.


 That is, the mind performs a series of operations each time and it repeats these processes in the same pattern and in sequence until it reaches the correct solution or guess in this game, and this is what the algorithms do.


 Expression algorithms


 Algorithms can be expressed in many types of symbols, including natural languages, pseudo-code (pseudocode), flowcharts, Dracon diagrams, programming languages, or control tables (handled by compilers, in English: Compilers)  .  Expressions of natural linguistic algorithms tend to be elongated and vague, and are rarely used for complex algorithms or technology.  Pseudo-code, flowcharts, Dracon diagrams and control tables are structured ways of expressing algorithms in a way that avoids many of the ambiguities common in natural language-based phrases.  Programming languages ​​are primarily intended to express an algorithm in a programmatic form that can be executed by a computer, but it is often also used as a means of defining or documenting the algorithm.


 There are a variety of possible representations and one can express a specific Turing machine program as a sequence of machine tables, such as flowcharts and Dracon diagrams, or as a form of primitive machine symbols.


 One of the most popular ways to express and represent an algorithm is through flowcharts or descriptive code.

Joseph
Joseph
Just be hope full and do not be upset at all

Comments