Documente Academic
Documente Profesional
Documente Cultură
Algorithm Complexity
FLOW CHART
Uses of a flowchart:
1. To specify the method of solving a problem.
2. To plan the sequence of a computer program.
3. Communicate ideas, solutions.
Drawing a flowchart
1. Identify input and output.
2. Apply reasoning skills to solve the problem.
3. Draw the flowchart using the appropriate symbols and arrows to show the
sequence of steps in solving the problem.
1. Terminal: The oval symbol indicates Start, Stop and Halt in a program’s logic
flow. Terminal is the first and last symbols in the flowchart.
2. Input/Output: Program instructions that take input from input devices and
display output on output devices are indicated with parallelogram in a
flowchat.
3. Processing: A box represents arithmetic instructions. All arithmetic
processes such as adding, subtracting, multiplication and division are
indicated by action or process symbol.
4. Decision Diamond symbol represents a decision point. Decision based
operations such as yes/no question or true/false are indicated by diamond in
flowchart.
6. Flow lines: Flow lines indicate the exact sequence in which instructions are
executed. Arrows represent the direction of flow of control and relationship
among different symbols of flowchart.
Sterneckert (2003) suggested that flowcharts can be modeled from the perspective
of different user groups (such as managers, system analysts and clerks), and that
there are four general types:
Document flowcharts, showing controls over a document-flow through a
system
Data flowcharts, showing controls over a data-flow in a system
System flowcharts, showing controls at a physical or resource level
Program flowchart, showing the controls in a program within a system
Uses of Flowcharts
Project planning
Program or system design through flowchart programming
Process documentation
Audit a process for inefficiencies or malfunctions
Map computer algorithms
Documenting workflow
Advantages of pseudocode –
Ex.- For a given value, Limit, what is the smallest positive integer Number for which
the sum Sum = 1 + 2 + ... + Number is greater than Limit.
Pseudocode:
1. Enter Limit
2. Set Number = 0.
3. Set Sum = 0.
4. Repeat the following:
a. If Sum > Limit, terminate the repetition , otherwise.
b. Increment Number by one.
c. Add Number to Sum and set equal to Sum.
5. Print Number and Sum.
Program
A compiler takes the entire source code and converts it into object code or
machine code at once for compiling (generates errors if any) which is typically
stored in a file. The object code is also refereed as binary code and can be directly
executed by the machine after linking. It occupies more memory space and is slow
in debugging because it generates intermediate object code. Some of the
programming languages, such as C and C++ use compilers.
Machine languages are very close to the hardware. Every computer has its machine
language. A machine language programs are made up of series of binary pattern.
(Eg. 110110) It represents the simple operations which should be performed by the
computer. Machine language programs are executable so that they can be run
directly.
OBJECT CODE
On compilation of source code, the machine code generated for different processors
like Intel, AMD, an ARM is different. To make code portable, the source code is first
converted to Object Code. It is an intermediary code (similar to machine code) that
no processor will understand. At run time, the object code is converted to the
machine code of the underlying platform.
Translators
The most general term for a software code converting tool is “translator.” A
translator, in software programming terms, is a generic term that could refer to a
compiler, assembler, or interpreter; anything that converts higher level code into
another high-level code (e.g., Basic, C++, Fortran, Java) or lower-level (i.e., a
language that the processor can understand), such as assembly language or
machine code. If you don’t know what the tool actually does other than that it
accomplishes some level of code conversion to a specific target language, then you
can safely call it a translator.
Assemblers
An assembler translates a program written in assembly language into machine
language and is effectively a compiler for the assembly language, but can also be
used interactively like an interpreter. Assembly language is a low-level
programming language. Low-level programming languages are less like human
language in that they are more difficult to understand