Algorithms Flashcards

1
Q

What are the three types of computational thinking?

A

abstraction - focusing on just the important details of the problem
decomposition - breaking a problem down into smaller parts
algorithmic thinking - creating a step by step solution to the problem

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

Linear search

A

checks each item in the list one by one until it finds what it is looking for
adv - doesn’t need to be ordered
disadv - not efficient, takes time

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

Binary search

A

find middle item. if it is the item you are looking for then stop. otherwise compare to the item you are looking for and then half the half you have left over. Then repeat until you are finished.
adv - More efficient
disadv - list has to be ordered

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

Bubble sort

A

Checks the first two items in a list, swaps them if they are in the wrong order and then moves onto the next two items and repeats the process. Once it has passed through the list once it goes through again until none of the items need swapping.
+ Simple.
– Takes a long time

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

Merge sort

A

Finds the middle item (n+1)/2 and splits the list in half. Repeats this step until the list is split into individual items (sub-lists). It them merges (joins) the sublists in pairs. Each time the sublists are paired they are sorted into the correct order.
+ Efficient
– Slow

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

Insertion sort

A

Looks at the second item in a list and compares it to the items that are in front of it, then inserts it into the right place. It then moves to the next item in the list and repeats these steps.
+ Quick for sorting small lists
– slow withlong lists

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

Flowchart symbols

A

Oval - start/stop
Diamond - decision
Rectangle - action

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

input, process, output

A

input - what info is entered
process - the thing that happens to the input
output - the result of the process

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

structure diagram

A

shows how a problem is broken down

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

common errors

A

syntax - mistakes using language e.g.comma or quotation mark
logic - mistake in the programs source code.
runtime - error whilst executing the program

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

trace tables and their uses

A

used to determine outputs from a program as it runs. They enable a programmer to find errors in their programs.

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