Fundamentals of Algorithms Flashcards
(50 cards)
Algorithm
An algorithm is a series of steps that are carried out in order to complete a task
What is computational thinking?
Computational thinking is a systematic approach to solving problems
Abstraction
The process of ignoring the unnecessary detail in a problem to make it easier to understand.
Decomposition
The process of breaking large problems into smaller, more manageable sub-problems.
How is decomposition most commonly represented?
In a structure chart
What are the 4 stages in the program development life cycle?
-Analysis
- Design
- Coding
- Testing
Computer System
The combination of physical components that make up a computer
Flowchart
A visual representation of an algorithm. Shows the flow of data and instructions.
What does the oval represent in a standard flowchart?
The start or end of an algorithm
What does a parallelogram mean in a flowchart?
An input or output
What does a rectangle represent in a flowchart?
A process
What does a diamond represent in a flowchart?
A decision
Pseudocode
A text-based method of representing algorithms - a simplified form of programming code.
What are the 3 basic programming constructs?
- Sequence
- Iteration
- Selection
Sequence
The order in which steps need to happen
Selection
Allows the program to follow different paths based on certain conditions
eg) IF statements
Nested Selections Statement
Where one or more IF statements are within another selection statement
How many options can you choose between if you have an IF…THEN…ELSE statement?
Two options
Which selection statement allows you to choose how many options there are to choose from?
IF… ELSE IF
Iteration
Allows parts of the program to repeat until a condition is satisfied
eg) Loops
Definite iteration
A group of steps are executed a specific number of times
Indefinite iteration
The section of code will repeat until a condition is satisfied.
The number of repeats can differ with different inputs.
What type of iteration is a FOR…ENDFOR loop?
Definite iteration
What type of iteration is a REPEAT…UNTIL loop?
Indefinite iteration