Algorithm design and structure diagrams Flashcards
Subroutine
A short section of a code within a program
Library routine
A commonly used function that is available to a program
What are the four ways of designing an algorithm?
1) Top down design 2) Structure diagrams 3) Flowcharts 4) Pseudo code
Top- down design
A design process where an overall task is broken down into smaller tasks
Decomposition
The process of breaking down a large task into smaller tasks
Structure diagram
A diagram that shows tasks that have been broken down and how they relate to each other
Module
An individual section of code that can be used by other programs
How to aprroach top-down design
1) Break program into smaller programs, work on each task separately. 2) Treat it as new program that can be broken into smaller programs. 3) Repeat this processes with new task until each can be solved.
What are the advantages of using a top down to design an algorithm?
More than one person can work to solve problems, they can bring the sub problems together at the end
What does the structure diagram show?
How the different modules relate to each other
What do the structure diagrams make easier to understand?
The logic of an algorithm
Syntax
The structure of a language
Two ways of designing a solution to a program?
1) Flowcharts 2) Pseudocode
Flowcharts
A way of representing the flow of an algorithm
Advantages of using a flowchart? (3)
1) The sequence can be easily seen 2) Paths can be easily followed 3) The logic can be understood more easily if visualised