What is Computational Thinking?
Computational thinking involves taking a complex problem and breaking it down into a series of small, more manageable problems. Each of these smaller problems can then be looked at individually.
What are three main principles of computational thinking
What is Abstraction and give an example
Example Sat Nav
We have to ask ourselves what is important and not important
Abstraction makes it clear to suggest a function or process in a simple and efficient manner.
One way to design an algorithm we could use flowcharts to represent the algorithm visually
Abstraction allows us to create a general idea of what the problem is and how to solve it. The process instructs us to remove all specific detail and any patterns that will not help us solve our problem. This helps us form our idea of the problem. This idea is known as a ‘model’.
Consider the problem of how a program might be required to calculate the area of any rectangle. All rectangles share general characteristics:
When abstracting, certain details are discarded but others are kept:
To solve this problem, all the program needs to be able to do is input a width and a height, then calculate the area from those numbers. The actual numbers are irrelevant - they change with every rectangle - and so are discarded.
An example of abstraction is the London Underground map. It details tube and rail lines and the stations that are on them. That is all that is required for a passenger to be able to plan a journey from one station to another. Other details, such as real geographical location, distance between stations, depth underground and number of platforms are not included as they are irrelevant to journey planning on the Underground.
What is decomposition?
e.g. Crossing a road.
What are the advantages of Decomposition?
What is an Algorithm?
An algorithm is a logical, step-by-step process for solving a problem.
Algorithm production is part of algorithmic thinking, an important concept in computational thinking. This focuses on how a desired solution can be reached by identifying the steps needed to get there.
What is algorithmic thinking?
Algorithmic thinking allows solutions to be
automated.
What is an input?
What is a process?
What is outputs?
Draw the different types of flow diagrams
What are the two types of error?
Syntax errors - errors which break the grammatical rules of the programming language. They stop it from being run/translated
Logic Errors - Produce an unexpected output. They will not stop the program from running.
What are Logic Errors?
What are Trace Tables used for?
Trace tables are a great way to spot logic errors
They show the input and the expected result.
How does a binary search work?
A binary search is an efficient method of searching an ordered list.
A binary search works like this:
Pros and Cons of Binary search:
• Requires the data set to be in order of a key field.
What are structure diagrams used for?
How does a Linear Search Work
A linear search is the simplest method of searching a **data** set.
Starting at the beginning of the data set, each item of data is checked until a match is made. Once the item is found, the search ends.
A way to describe a linear search would be:
What are Pros and cons of Linear search:
• Is very inefficient for large data sets
How does a bubble sort work
Bubble sorts work like this:
Pros and Cons of Bubble sort?
Bubble sort is:
But:
How does a merge sort work?
part 1
Pros and Cons of Merge Sort?
But :
Insertion Sort Pros and Cons?
But