2.1 Computational Thinking Flashcards
What are the three types of computational thinking? [3]
Abstraction [1] Decomposition [1] Algorithmic thinking [1]
What is abstraction? [2]
Removing unnecessary detail [1] to focus on the important parts of a problem [1]
What is decomposition? [2]
Breaking a large problem down into smaller problems [1] until the problems are small enough to solve [1]
What is algorithmic thinking? [2]
Structuring a problem so it can be solved by a computer [1] usually by making it quantitative [1]
What are the three programming constructs? [3]
Sequence [1] Selection [1] Iteration [1]
What is programming in sequence? [2]
Instructions in order [1] processed one after the other [1]
What is programming using iteration? [2]
Repeating sections of code [1] until conditions are met [1]
What is programming using selection? [2]
Choosing which code to run [1] based on a decision [1]
When writing an input in an algorithm what must we remember to do? [1]
Assign the input to a variable [1]
What is a structure diagram? [3]
A diagram that shows the problem you’re solving at the top [1] then breaks the problem down into smaller problems below [1] then breaks those problems down into smaller problems etc [1]
Describe the steps a linear search would use to look for an item in a list [4]
Look at each item in order [1] starting at the beginning [1] until the item is found and the position of the item is returned [1] or the end of the list is reached and the search returns not found. [1]
What is the prerequisite for binary search data? [1]
It must be in order [1]
Describe the steps a binary search would use to look for an item in a list [5]
Find the middle of a list (round down if it would be a decimal) [1]
If it’s the number searched for, return the index of the number [1]
If it is higher than the number, discard the middle number and lower half of list and repeat [1]
If it is lower than the number, discard the middle number and the upper half of list and repeat. [1]
If only one value is left and it’s not the number we’re looking for, the number is not in the list [1]
Complete a binary search for the number 7 in this data:
2 4 6 7 8
2 4 6 7 8 # Find middle number - 6.
# 6 is lower than 7 so discard 6 and lower half of list.
7 8 # Find middle number - between 7 and 8, so go left
# Middle number is 7. Return index of 7.
Describe the steps a merge sort would take to sort a list [4]
Split the list in half, then split the sub lists in half [1] until all numbers are in a list of length 1 [1]
Combine the lists in pairs, in order [1] and repeat until all lists have been combined into a sorted list [1]