modelling with algorithms Flashcards

1
Q

unambiguous

A

person or machine does not have to make choices (other than true or false)

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

deterministic

A

output always the same (no randomness)

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

methods of bin packing

A

first fit
first fit decreasing
full bin packing

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

pros and cons of methods of bin packing

A

full bin works well for small numbers of items and gives optimum solution
however time grows exponentially
other methods faster

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

heuristic

A

use some knowledge about the problem to reduce the time taken, sometimes trading speed for optimal outcome

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

quicksort

A

pivot element
compare to each element in list sort before or after
pick another pivot
repeat until sorted

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

Algorithmic complexity

A

Measure of how many basic operations (comparisons) an algorithm needs to run based on the size of the problem
Used to classify based on performance
Worst case scenario
Big O notation

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

Bubble sort complexity

A

Quadratic

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

Insertion sort complexity

A

Quadratic

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

Merge sort complexity

A

Log(n)

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

Full bin packing complexity

A

kn

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

A computer algorithm of quadratic complexity takes 0.25 s for 100 entries, how long would it take for 400?

A

100x4 = 400
0.25 x 16 = 4s

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

Simple graph

A

No loops or multiple edges

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

Degree/ order of vertex

A

How many edges leave the vertex

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

No of edges

A

0.5n(n-1)

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

Sum of degrees

17
Q

Sum of degrees (no edges)

A

Sum of degrees = 2x no of edges

18
Q

Bipartide

A

Two sets of vertices
Edges connect vertices from one set to another do knot connect vertices within a set

19
Q

Complete bipartides denoted by

A

Kr,s
Where r= vertices in set 1
And s= vertices in set 2

20
Q

Isomorphic

A

Same graph rearranged

21
Q

Eulerian

A

All orders are even

22
Q

Semi-eulerian

A

Two odd orders

23
Q

Tree

A

Simple connected graph with minimum possible no of arcs

24
Q

Network

A

Arcs have weights

25
Forest
Collection of trees Disconnected with no cycles
26
Incidence matrix
Can represent arcs and loops How many ways to get from one to another
27
Kruskal’s
Minimum spanning tree Add edge with lowest weight unless it creates a cycle
28
Prim’s
Start at one node Add shortest edge connected to node Add shortest node connected to any node already in tree
29
Dijkstras
Shortest path Start at A Label node and write distance Update all adjacent nodes Pick node with smallest working value Work backwards from end to give shortest path
30
Adjacency matrix
Weighted graphs
31
Prim’s from table
Choose vertex Delete row Number column Circle lowest undeleted entry in numbered columns Ringed entry = next to be added to tree Repeat until all rows deleted
32
Dijkstras from table
Label starting vertex and cross out column Work across row adding working values to each box Label box with lowest working value and cross out its column Work along row updating any working values Repeat until all columns deleted