Content Area 1 - Problem Solving Flashcards
Algorithms
A plan or well-defined set of step-by-step instructions to solve a problem.
Algorithms must:
- Have clear, defined steps
- Clearly defined inputs and outputs
- Be simple generic and practical
Algorithms can be represented as a flowchart, written description, pseudocode or program code
Advantages of Algorithms
- Easy to understand
- Step-by-step representation of a solution to a given problem
- The initial program is broken down into steps, making it easier to code
Disadvantages of Algorithms
- Creating complex algorithms can be time consuming
- Some constructs can be difficult to represent
Flowcharts
A visual representation of an algorithm which can be used to solve a problem
Advantages of Flowcharts
- The flow of the program can be clearly seen
- Flowcharts are created using a standardized set of symbols so can be interpreted and understood by a range of people
Disadvantages of Flowcharts
- With a large, complicated problem the flowchart can become difficult to follow
- Changes to the design may result in the flowchart being amended or redrawn
Written Descriptions
- Use natural language or plain English without a defined format
- Should be easy to understand and contain minimal specific detail
- Must include all parts of the final decomposition
Advantages of Written Descriptions
- There is no formal syntax, so many people can create a written description
- It is automatic and natural to user ‘proper’ English
Disadvantages of Written Descriptions
- The temptation to create a complete description
- Failure to include very step required
Pseudocode
Pseudocode is an informal programming description that outlines process flow. It resembles high-level programming languages and provides a framework for what the final program should achieve. While it has its own syntax similar to actual programming languages, pseudocode must be converted to a programming language to run.
Advantages of Pseudocode
- Can be converted into a programming language with minor changes
- Can be easy to follow and understand even if there are errors
- Changes can be implemented quickly
Disadvantages of Pseudocode
- Can be time consuming to write clear and well-structured pseudocode
- Can be difficult to see the logical flow of the program
Program Code
Code written to solve the problem which follows the rules of the selected programming language. However, the program code can be used to create an algorithm, known as ‘draft program code’
Advantages of Program Code
- Very probable that the person creating the program code will have some programming knowledge
- Not necessary to use the correct syntax
- All the required constructs will be available to be included in the draft code
Disadvantages of Program Code
- Easy to begin creating draft code but end up creating the final program code
- Full decomposition may not be completed