02 Section 4 - Algorithms Flashcards
What are the three key techniques for computational thinking?
Decomposition
Abstraction
Algorithmic thinking
Define decomposition:
Breaking a complex problem down into smaller problems and solving each one individually
Define abstraction:
Picking out the important bits of information from the problem, ignoring the specific details that don’t matter
Define Algorithmic thinking:
A logical way of getting from the problem to the solution. If the steps you take to solve a problem follow an algorithm then they can be reused and adapted to solve similar problems in the future
What is pseudocode?
Not an actual programming language but it should follow a similar structure and roughly read like one
-shows the algorithm’s steps, without worrying about the specific syntax of a programming language
What are the features of pseudocode?
- quick to write
- can be easily converted into any programming language
- different ways to write pseudocode, priority is that the person reading it can follow and understand it
What are aspects and rules to follow for pseudocode?
- VARIABLES -are named at the start
- INDENTATION -makes it more readable
- USE CAPITAL LETTERS FOR COMMAND AND KEY WORDS (e.g. PRINT, IF, ELSE, INPUT…)
What is the symbol used for start/stop for flow diagrams?
The beginning and end of the algorithm are put into boxes with rounded corners
What is the symbol used for inputs/outputs for flow diagrams?
Anything that is put into or taken out of the algorithm goes into a parallelogram box`
What is the symbol used for processes for flow diagrams?
General instructions, processes and calculations go in rectangular boxes
What is the symbol used for decisions for flow diagrams?
Decisions, often a ‘yes’ or ‘no’ question, are put in diamond boxes
What is the symbol used for sub routines for flow diagrams?
Sub routines are like sub programs, they reference other flow diagrams
-a rectangle with extra lines at either end (splitting it up into a small vertical rectangle, a large horizontal rectangle then another small vertical rectangle)
What is the symbol used for showing directions for flow diagrams?
Arrows connect boxes and show the direction you should follow. Some boxes might have multiple arrows coming in or going out of them
What are the different ways you can write algorithms?
Pseudocode
Flow diagrams
What are the three ways which a program can be written or features that they can contain?
Sequence
Selection
Iteration
What is sequence?
When there is only one way from start to end