2.1 Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is abstraction and decomposition

A

Abstraction - removing unnecessary information, e.g. the London Tube map
Decomposition - the process of breaking down a task into a sequence of simpler subtasks

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

How do you write pseudocode

A

Basically writing in python but if you forget how to do something, you can just write it how you would say it, e.g. ** = ^

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

What does an arrow mean in a flowchart

A

Flow line - shows the way to go in a flowchart

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

What does an oblong mean in flowcharts

A

Terminal - the start and the end of a process

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

What does a rectangle mean in a flowchart

A

Process - a set of operations that can change a value

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

What does a diamond mean in a flowchart

A

Decision - which path the flow line should follow

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

What does a parallelogram mean in a flow chart

A

Input/output - ask for the user to enter something or want to print something

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

What does a square with thin rectangles on the side mean in a flowchart

A

Sub process - a function/procedure

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

What are the searching algorithms

A

Linear - compares each value with the value you are looking for
Binary - splits the list in half, discards the half which wont have the value you are looking for

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

When would you use linear search over binary search and vice versa

A

Linear:
For smaller lists
Values can be in any order
Easier to code

Binary:
For larger lists
Values must be in order
Harder to code

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

What are the sorting algorithms

A

Bubble - it will compare the values until the highest value is at the top of the list
Merge - split the list into halves until the values are separate. The values are put together in the parts they were split into and sorted
Insertion - there is a sorted and unsorted and a value in the unsorted list and is compared to the values in the sorted list and it is put into its right place

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