2.1 Algorithms Flashcards

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

Computational thinking

A

Structuring problems in a way that computers can easily follow

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

Decomposition

A

Breaking a problem down into smaller subproblems

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

Abstraction

A

Removing or hiding unnecessary details from a problem so that important details can be focused on or more easily understood

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

Algorithmic thinking

A

Deciding on the order that instructions are carried out and identifying decisions that need to be made by the computer

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

Structure diagram

A

Graphical method of decomposing a problem
-each layer breaks down layer above it into smaller and smaller sub-problems
-root and node

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

Flowchart

A

Graphical representation of an algorithm
-line
-process
-subprogram
-input/ output
-decision
-terminal

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

Flowchart symbols - line, process, subprogram, input/output, decision, terminal

A

Line - arrow
Process - rectangle
Subprogram - rectangle with two lines
Input/ output - parallelogram
Decision - diamond
Terminal (start/end) - rounded rectangle

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

Trace table

A

Tool used to follow each line of an algorithm through step by step
-show contents of each variable after each line has been carried out and any output

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

Standard searching algorithms

A

-linear search
-binary search

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

Linear search

A

Inspecting each item of the list in turn to check if it is the desired value
-when value is matching, item is found. If not, next item is checked
-inefficient
-works on unsorted data

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

Binary search

A
  1. calculate a mid-point in the data set
  2. check if that is the item to be found
  3. if the item to be found is lower than the mid-point, repeat on the bottom half of the data set
  4. if the item to be found is greater than the mid-point, repeat on the top half of the data set
  5. repeat until the item is found or only one item left

-discard middle value
-more efficient
-only works on sorted list

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

Standard sorting algorithms

A

-bubble sort
-merge sort
-insertion sort

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

Bubble sort

A
  1. Comparing pairs of value
  2. If two values are in wrong order, swapped
  3. Repeated for each further pair of values
  4. When last pair of values has been compared, first pass is complete
  5. Algorithm repeats until pass has been completed with no swaps occurring - guaranteed to be in order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Insertion sort

A

Splits the list to be sorted in two parts: sorted side and unsorted side
1. Initially, sorted side contains first item in a list, everything else on the unsorted side
2. first item from unsorted list is inserted to sorted list
3. Repeat until unsorted list has no values

-more efficient
-tricky to code

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

Merge sort

A
  1. Splits data up into individual lists
  2. Pairs of lists are merged back together in order
  3. Repeats until there is one merged list

-more efficient - sorts large list of random values in a quicker time
-not best for nearly sorted or small lists
-divide and conquer

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