Computational Thinking, Algorithms And Programming Flashcards

1
Q

What is abstraction?

A

A technique that simplifies a problem by removing unnecessary detail so that you can focus on the important parts that are relevant to the problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give two examples of abstraction in every day life

A
  • Maps
  • Money
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is decomposition?

A

Decomposition means breaking a complex problem into smaller, more manageable sub-problems.
Each smaller part can then be solved individually, before all the sub-solutions are combined to solve the original problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Give two advantages of decomposition

A
  • Decomposition allows large teams to each take a part of a problem and work on it.
  • Decomposition allows seemingly impossible problems to be solved by splitting them into simple tasks.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a structure chart?

A
  • Structure charts are used to visually represent breaking a large problem down into the smaller parts that make it up.
  • Each box represents a smaller problem to be solved.
  • Lines show which bigger problem the box is a part of.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is algorithmic thinking?

A

A way of solving problems by producing algorithms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an algorithm?

A

An algorithm is a reusable set of instructions (a series of steps) to solve a given problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give two examples of algorithms used in every day life

A
  • Make a cup of tea
  • Get dressed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How are algorithms written in computing?

A
  • Algorithms can be written as a set of numbered steps to follow.
  • A non-technical example of a written algorithm is a cooking recipe.
  • In computing, we often represent algorithms using pseudocode or flow diagrams.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is pseudo code?

A
  • A way to write out algorithms using code-like statements.
  • It is intended to be very readable, and easy to understand.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the purpose of pseudo code?

A
  • Pseudocode isn’t a programming language.
  • Pseudocode is used to plan algorithms, focusing on the logic and steps rather than language-specific syntax.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the main focus of pseudo code?

A

To set out the logic of an algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a flow diagram?

A
  • Flow diagrams are used to visually represent the steps that make up an algorithm.
  • A standard set of shapes are used to represent different types of step.
  • Arrows represent the flow of control, or what to execute next.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What part of a flow diagram does the oval represent?

A

Start or end of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What part of a flow diagram does the rectangle represent?

A

A process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What part of a flow diagram does the parallelogram represent?

A

Input or output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What part of a flow diagram does the diamond represent?

A

A decision;
* A decision has two labelled arrows coming out of it.
* The ‘Yes’ arrow is followed if the condition in the diamond was true, otherwise the ‘No’ arrow is followed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Can pseudo code be run on the computer?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is an identifier in an algorithm and how can it help with interpreting?

A
  • Identifiers are the names of variables, constants, and subroutines.
  • These often give strong clues about the purpose of an algorithm.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is a comment and how does it help with interpretation?

A
  • Comments are descriptions of the code.
  • Comments will often state the purpose of a given algorithm.
  • Comments are often the clearest way to identify an algorithm.
21
Q

Give three examples of issues in algorithms

A
  • Incorrect identifiers
  • Incorrect operators
  • Missing lines
22
Q

How is a trace table used?

A
  • You can draw a table with a column for each variable in the algorithm.
  • Use this table to record the value of each variable, and carefully follow through the code until the end.
  • Finally, the trace table should include your answer.
23
Q

Give two methods of completing algorithms

A
  • Identify the algorithm
  • Produce a trace table
24
Q

Give three examples of identifiers

A
  • Subroutine name
  • Variable name
  • Constant name
25
Q

What is meant by complete the algorithm?

A

State the output

26
Q

What is a search algorithm?

A

A search algorithm is a set of instructions for finding a specific item of data within a data set.

27
Q

What is an effective search?

A

An effective search is one which will always either find the solution or determine that the target data is not present.

28
Q

What is an efficient search?

A

An efficient search will find the solution quickly regardless of its location within the data set.

29
Q

Give two examples of search algorithms

A
  • Linear search
  • Binary search
30
Q

How does a linear search work?

A

It checks every item until the one needed has been found

31
Q

Give an example of pseudo code for a linear search

A

for item in dataset
if item == target then
return True
endif
endfor
return False

32
Q

Give a pro and a con for linear searching

A

Pro
* Easy to implement
Con
* Slow on long lists

33
Q

How does a binary search work?

A
  • Split the list in then disregard the list that does not contain the item
  • Repeat this until the item is found
34
Q

Can binary searches be used on all lists?

A

No, the list must be ordered

35
Q

Give a pro and a con of binary searches

A

Pro
* Faster than linear search
Con
* List must be ordered before searching

36
Q

What is an efficient sorting system?

A

An efficient sort algorithm is one which can sort a dataset in a short time.

37
Q

Give three sorting algorithms

A
  • Bubble sort
  • Insertion sort
  • Merge sort
38
Q

What is a sorting algorithm?

A

A sort algorithm is a set of instructions to arrange a dataset into a particular order.

39
Q

How does a bubble sort work

A

Compares the first two items and swaps them if needed, this goes on through the whole list

40
Q

Give two pros of a bubble sort

A
  • Easy to implement
  • Doesn’t use much memory
41
Q

Give a con of bubble sorting

A

Not efficient

42
Q

How does an insertion sort work?

A

Each item is checked then inserted into the correct place

43
Q

Give two pros of the insertion sort

A
  • Easy to implement
  • Little memory used
44
Q

Give a con of insertion sorting

A
  • Not very efficient
45
Q

How does a merge sort work?

A
  • Split the first list into parts and order each item in each part.
  • Once all the lists are ordered, merge them together
46
Q

Give two cons of a merge sort

A
  • Slow for small lists
  • Needs additional memory
47
Q

Give a pro of the merge sort

A

Very efficient

48
Q

When is it a bad idea to use merge sort?

A

On a small list that is unlikely to grow