Solo Technopark

Programming Algorithm

The algorithm is a sequence of logical steps in solving problems systematically arranged. The problem can be anything, with a note to every problem there is a requirement that the initial conditions must be met before running the algorithm.

The concept of the algorithm is often equated with a prescription. A recipe usually have a list of ingredients or spices that will be used, the order of execution, and how the results of the processing sequence. If the material used is not listed (not available), then the prescription will not be workable. Likewise, if the order process is not uniform, then the expected results will not be obtained.

Different algorithms can be applied to a problem with the same conditions. The level of complexity of an algorithm is a measure of how much the algorithm computation required to solve the problem. Generally, the algorithm can solve a problem in a short time has a low level of complexity, while the algorithm that takes a long time to solve a problem requires a high level of complexity.

Algorithm Selection Criteria

1. Out put

Referring to the definition of the algorithm, the algorithm should have the output must be a solution of the problem being solved.

2. Effectiveness and efficiency

Said to be effective if the algorithm generates an appropriate solution to the problems solved, in the sense that the algorithm should be appropriate.

Said to be efficient if the processing time of an algorithm is relatively shorter and less use of computer memory.

3. Finite number of steps

Rows of instruction are made to be in a certain order or to be finite so that the problems encountered can be resolved by not requiring a relatively long time.

4. (semi Algorithm) Ends

Troubleshooting should stop. And can cause other problems.

5. Structured

Problem solving using the steps in order.

Consider the following simple algorithm:

Algorithms to calculate the area of a triangle.

start

Read the data base and height

Broad is the base times the height times 0.5

Show Size

stop

The above algorithm is very simple algorithm, there are only five steps. In this algorithm may not find looping or election. All of the steps is performed only once.

Glance algorithm above is true, but if we look closely then this algorithm contains a fundamental error, namely: there is no restriction on the value of the data to the base and height. What if the value of the data base or higher is the number 0 or a negative number? Obviously the results out to be not as expected. In cases like this we need to add a step to ensure the value of the base and high qualified, for example by checking the incoming input. If the input value of the base and the height is less than 0, then the program will not run. So that the above algorithm can be changed to be like the following example.

Another example:

The result of the calculation algorithm repair area of the triangle.

start

Read the data base and height

Check the data base and height, if the value of the data base and the height is greater than zero then proceed to step 4 if not then stop

Broad is the base times the height times 0.5

Show Size

stop

From the above explanation can be concluded about the basic algorithm. First, the algorithm must be true. Second, the algorithm must stop and after the stop, the algorithm gives the correct result.

ALGORITHM ANALYSIS

1. How to plan an algorithm

Determine some models / design as problem solving so that it appears some models that will be taken where the best solution.

2. How to declare an algorithm

3. How validity of an algorithm

4. How to analyze an algorithm

5. How to test the program of an algorithm

Method / procedure of algorithm

1. Words
2. The flowchart
3. Statement program

ALGORITHM TEST STAGE PROCESS

1. Debugging Phase

Phase of a process executable program that will make corrections to the program error / error. This program errors may be errors in the writing program either logic or syntax.

2. Profiling Phase

Phase that will work if the program is correct.

Understanding LOGIC

The logic is derived from the Greek meaning LOGOS science. Logic basically philosophical thought. Thinking means perform an action that has a purpose. So understanding Logic is the science of thought / thinking with a variety of actions that have a specific purpose.

Different Between Algorithms and Programs

The program is a set of computer instructions, whereas systematic methods and stages in the program is the algorithm. The program is written using a programming language. So can we call that the program is an implementation of a programming language.

Some experts gave a formula that somehow data structures and algorithms are closely related to a program. Good algorithm without selecting appropriate data structure will make the program less good, semikian versa.

Making the algorithm has many advantages such as:Manufacture or writing the algorithm does not depend on any programming language, meaning independent of writing algorithms and computer programming language that executes it.

1. Writing the algorithm does not depend on any programming language, meaning independent of writing algorithms and computer programming language that executes it.
2. Algorithmic notation can be translated into various languages.
3. Regardless of the programming language, which will be issued the same output as the same algorithm.

Some things you need to note in writing the algorithm:

1. The text contains a description of the algorithm steps to resolve the problem. The description can be written in any notation as long as it is easy to understand and be understood.
2. There is no standard notation in the text entry such algorithms in a programming language notation. Notation used in writing algorithms called algorithmic notation.
3. Each person can make a rule writing and algorithmic notation itself. This is because the text algorithm is not the same as the program text. But that algorithmic notation easily translated into a specific programming language notation, the notation should correspond to the notation of the algorithmic programming languages in general.
4. Algorithmic notation is not a programming language notation, because it pseudocode in algorithmic notation can not be executed by the computer. To be executed by a computer, the pseudocode in algorithmic notation must be translated or Programs = Algorithms + Data Structures translated into the selected programming language notation. Keep in mind that the person who wrote the program is very dependent on the rules of grammar and run the engine specifications.
5. Actual algorithm used to assist us in converting the problem into a programming language.
6. The algorithm is the result of conceptual thinking, so that can be implemented by computer, the algorithm must be translated into a programming language notation.

There are several things that must be considered when the translation is:

1. Variable declaration.

What programming language to be used require variable declaration because not all programming languages need it.

2. Selection of data types.

If the programming language to be used require variable declaration it is necessary to consider when selecting the type of data.

3. Usage instructions.

Some instructions have the same functionality but each has different advantages and disadvantages.

4. Syntax rules.

At the time of writing the program we are bound by the rules of syntax of the programming language to be used.

5. Display results.

At the moment we are not thinking of making algorithms view the results will be presented. Technical things we noticed when convert them into the program.

6. The operation of the compiler or interpreter.

The programming language used include groups compiler or interpreter.

Some of the requirements to make a good algorithm is:

1. High confidence level (reliability).

The results of the process should be high accuracy and correct.

2. Efficient processing (low cost).

The process should be completed as soon as possible and frequency calculations were as short as possible.

3. General nature.

Not something just to finish one case alone, but also for other more general cases.

4. Could be developed (expandable).

It must be something that we can further develop based on existing requirements change.

5. Easy to understand.

Anyone who read, he will be able to understand your algorithm. Hard to pin down a program would make it difficult in-maintenance (managed).

6. High portability (Portability).

Can be easily implemented in a variety of computer platforms.

Algorithm Presentation

Algorithm Presentation can be outlined in 2 forms of presentation that is writing and drawing. Algorithms are presented with writing that is the structure of a particular language (eg, Indonesian or English) and pseudocode. Pseudocode is a code that is similar to the actual programming code. Pseudocode is written based on a specific programming language for example Pascal, C or Python, so it is more appropriately used to describe algorithms which will be communicated to the programmer. Pseudocode is more detailed than the structure of the English language, for example in the states syntax, data types used and others. While the algorithm is presented with an image, for example with the flowchart. Flowchart is not the only way to describe or explain the algorithm. Other ways include:

1. Structure chart

2. DFD (Data Flow Diagram)

3. Warnier Diagram

4. IPO (Input Process Output)

5. HIPO (Hierarchical Input Process Output)

Flowchart (flowchart) is a graphical representation of an algorithm or procedure to solve a problem. By using the flowchart will allow us to check whether there are parts that forgotten in the analysis of the problem. In addition, the flowchart is also useful as a facility for communication between programmers working in a project team. Flowchart there are two kinds:

1. System Flowchart

That is a flow diagram illustrating a system of computer equipment that is used in the data processing and the relationship between the equipment. Flowchart system used to describe the sequence of steps to solve the problem but only to describe the procedures established in the system.

2. Program Flowchart

That is a chart that illustrates the logic sequence of a troubleshooting procedure. Symbols used are American National Standards Inc.

Stages of Programming

Previous need to understand three basic understanding of the program, programming languages and programming. The program is said, expressions, statements compiled and assembled into a single entity in the form of a sequence step procedure to solve the problem that is implemented by using a programming language that can be executed by a computer. Programming language is the procedure or manner of writing programs. While programming is the process of implementing the sequence of steps to solve a problem by using a programming language.

Programming includes two stages:

1. Problem Solving Phase
2. Implementation Phase

Steps to resolve the problem are as follows:

Understand or analyze problems

Things that should be known in the analysis of the problem so that we know how these problems:

• Initial conditions, ie inputs are available
• The final condition, namely the desired output
• Other data available
• Operators are available
• Terms or constraints that must be met

Designing or formulating algorithms

When the problem is complex then we divide into modules. Phase of the algorithm often starts from a global first step. This global step was refined to become more detailed step or detail. This approach is very useful in making algorithms for complex problems. Smoothing lanngkah by breaking step into several steps. Each step is described further into simpler steps. The smoothing step will continue until each step is quite detailed and precise to be implemented by the processor.

The characteristics of a good algorithm:

• Precise (right & conscientious)

Each instruction must be written carefully and no doubt, so each instruction must be stated explicitly and not be discarded because the processor is assumed you know. Each step must be clear and definite.

• The number of steps or instructions finite and indefinite

This means that for the same case, a certain number of steps remain and although the data are different.

• Effective

There should be no instruction that can not be done by the processor that will run it.

• Must terminate

The course of the algorithm should be no stopping criteria. The question is whether, if the number of instructions a finite then surely terminate?

• The resulting output right

If the logical algorithm steps are followed carefully and then produced the desired output.

Writing Program

The algorithm has been made translated into computer language into a program. When writing a program, a programmer will be bound by the syntax-syntax of the instruction in the programming language used. This does not happen when preparing or making algorithms because no standardized notation in the text entry such algorithms in a programming language notation. Notation used in writing algorithms called algorithmic notation. Each person can make a rule writing and algorithmic notation itself. This is because the text algorithm is not the same as the program text. But that algorithmic notation easily translated into a specific programming language notation, the notation should correspond to the notation of the algorithmic programming languages in general.

Algorithmic notation is not a programming language notation, because it pseudocode in algorithmic notation can not be executed by the computer. To be executed by a computer, the pseudocode in algorithmic notation should be translated or translated into the selected programming language notation. Keep in mind that the person who wrote the program is very dependent on the rules of grammar and run the engine specifications. It should be noted that the selection of the wrong algorithm will cause the program to have an unfavorable performance.

The program has a good standard of assessment:

Troubleshooting Techniques Standard

1. Top-Down Technique

Troubleshooting techniques most commonly used. The principle is a complex problem is divided into several groups of smaller problems. From the small problem analysis. If possible then the problem will be divided again into sub-sections and then put together following the steps for completion in more detail.

2. Bottom-Up Technique

The principle of bottom-up technique is a complex problem solving is done by combining the existing procedures into one unified program as the problem resolution.

Standard programming

1. Truth logic and writing
2. The minimum time for writing programs
3. The maximum speed of execution of the program
4. Expression memory usage
5. Ease of caring for and develop programs
6. User friendly
7. Portability
8. Modular programming
9. Standard program treatment
10. Documentation
11. Instruction Writing
12. Standard procedure

Test Results

The first time should be tested whether the program can be run. If the program can not run it needs to be repaired writing syntax but if the program can run it must be tested using the usual data is data that is expected by the system created and extreme data is data that is not expected by the system. Examples of such programs require extreme data is input the amount of data but the user to fill with negative numbers. The program should be tested using a relatively large data. Repairing or correcting an error or mistake can be very expensive because there are several reasons, including:

1. Program created by any programmer could have a different structure even though the results are the same. So if we can not understand the purpose of the rectification program programmers will take a long time and inefficient.

2. In the error correcting program, we must see the need now. So could the error program is tailored to the current situation.

3. Fixing the error took a long time because of improvements to the error could cause another error or correct other errors so that everything can be resolved.

4. Correcting errors of course will learn the purpose of the overall program and its data structures. So of course, will require a lot of time, in addition to the costs incurred.

5. Creating documentation

Documentation of the program there are two kinds of internal and external documentation documentation. Internal documentation is documentation generated in each of our programs that we should write a program line comment or information that allows us to remember the logic contained in the instruction, it is very useful when one day the program will be developed. External documentation is documentation of the programs conducted outside the program that makes the user guide or manual of rules or how to run the program.

Programs Used

If the program we have made are in accordance with what we want then we can use the program.

Basic Structure Algorithm

The algorithm contains steps to resolve a problem. Such measures may include actions of runs (sequences), the selection of the action (selection), the repetition of the action (iteration) or a combination of all three. So the basic structure of the algorithm builder there are three, namely:

1. Sequence Structure

Used to program the sequential instruction or order.

2. Selection Structure

Used for programs that use the selection or screening conditions.

3. Repetition Structure

Used for program instructions are executed repeatedly.

Algorithm Efficiency

Things to consider in making the algorithm is a process. To determine the exact time is a difficult job. Analysis desirable to express the efficiency of the algorithm must be made in general terms to be used in all algorithms, regardless of its implementation. In analyzing an algorithm we must focuses itself on active operations which is central to the program, which is part of the most frequently executed program. Other parts such as data entry, assignment and so can be ignored, because this section is not executed as often as active operation. The number of active operations execution was then calculated.

STP Homepage

Solo Techno Park (STP) area is officially under the management of the local city Government of Surakarta.