2.1 Flashcards
What is computational thinking?
Formulating a problem and expressing its solution in such a way that a computer can carry out.
What are the 3 basic steps of computational thinking?
Abstraction
Decomposition
Algorithmic thinking
What is abstraction?
Identifying the key parts of the problem and hiding those that aren’t important so that it becomes easier to solve.
What is decomposition?
Breaking down a complex problem into smaller, more manageable parts which are easier to solve.
How do you carry out decomposition?
- Identify the main problem
- List the main components, functions or tasks
- Break down these into smaller smaller tasks which can be completed separately
What is algorithmic thinking?
The consideration that goes into how to solve a problem using one or more algorithms.
What is an algorithm?
The series of steps that a program needs to perform to solve the problem.
What is a structure diagram used for?
To show the structure of a problem, its subsections and links to other subsections.
What are flowcharts?
Useful tools that can be used to develop solutions to a problem.
What is a trace table used for?
To show how the values of variables change during the execution of a program.
When does a syntax error occur?
If a statement is written that doesn’t obey the rules of the programming language.
When does a logic error occur?
If the program doesn’t do what the user intended.
How does a binary search work?
It searches a list by repeatedly dividing in half the portion of the list that could contain the required data item.
How does a linear search work?
Each item is checked one by one for the desired item
How does a bubble sort work?
It repeatedly goes through the list to be sorted and sorts it by swapping adjacent elements if they are in the wrong order
How does a merge sort work?
In the first stage, the list is divided in half repeatedly until each element has its own list. In the second stage, each set of sub-lists is repeatedly merged to produce a sorted list.
How does an insertion sort work?
Starting with the second item in the list, it looks at each remaining item and places it in the correct position in the list.
Evaluate a binary search?
Only works on a sorted list
Evaluate a linear search?
Slow in a large list, but can be used on unsorted lists
Evaluate a bubble sort?
Can be used at any time and is easy to program but is very inefficient for large data sets
Evaluate a merge sort?
Very fast, especially with larger data sets
Evaluate an insertion sort?
More efficient than the bubble sort, especially in smaller data sets as it skips the sorted values