paper 2 - section 4 Flashcards
what are the three key techniques for computational thinking?
- decomposition
- abstraction
- algorithmic thinking
what is decomposition?
breaking a complex problem down into smaller problems and solving each one individually
what is abstraction?
picking out the important bits of information from the problem, ignoring the specific details that don’t matter
what is 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
how might you use decomposition to sort a list of product names into alphabetical order?
- one part of the decomposition might decide what alphabetical order means - letters are straightforward, but what if some entries in the list contain numbers and punctuation?
- another part of the decomposition might look at comparing the entries - this could be decomposed further into how you could compare two entries, three entries, etc.
how would abstraction help to sort a list of product names into alphabetical order?
abstraction will help the programmer focus on the important bits - it doesn’t matter what the entries are and what they mean. The important information is the order of the characters in each entry
how will algorithmic thinking help to sort a list of product names into alphabetical order?
algorithmic thinking will put the tasks into a step-by-step process. For example, you might compare the first two entries and order them, then compare the third entry to each of the first two and put it in the correct place, then compare the fourth entry to each of the first three, etc.
what is pseudocode?
pseudocode is not an actual programming language but it should follow a similar structure and roughly read like one. The idea is that pseudocode clearly shows an algorithm’s steps without worrying about the syntax of any particular programming language
what are the advantages of pseudocode?
it is quick to write and can be easily converted into any programming language
in a flowchart, what does an oval box mean?
start/stop - they’re used at the beginning and end of the algorithm
in a flowchart, what does a parallelogram box mean?
inputs/outputs
what do you use a rectangular box for in a flowchart?
processes
what do you use a diamond box for in a flowchart?
decisions - often ‘yes’ or ‘no’ questions
what does a shorter rectangle within a longer rectangle mean in a flowchart?
sub-routines
what are arrows used for in fllowcharts?
arrows connect boxes and show the direction you should follow. Some boxes might have multiple arrows coming in or going out of them