Further Decision Flashcards

1
Q

Trace Table (C1)

A

Used to record values of each variable as the algorithm

e.g.
- Instruction Step
- n
- A
- B
- C
- Print

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

Flow Charts (C1)

A

Stretched Circle - Start/End
Rectangle - Instruction
Rhombus - Decision (question)

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

Bubble Sort (C1)

A

Comparison of adjacent items in a list, if they are out of order, you swap them.

Once a pass is completed without any swaps, the list is in order.

ALWAYS SORT BACK TO FRONT

‘Ascending’ (Rising value) => Start with organising biggest values at the end.

‘Descending’ (Decreasing value) => Start with organising smallest values at end.

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

Quick Sort (C1)

A

Select a pivot then split items into 2 sub-lists;
- Values < Pivot
- Values > Pivot

Repeat until all items have become pivots - the list should now be in order.

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

First-Fit Algorithm (C1)

A

Consider items in order given - fitting into first bin possible.

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

First-Fit DECREASING Algorithm (C1)

A

Same as FF but first sort items into descending value before applying the algorithm.

(Fit into first bin possible)

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

Full-bin packing (C1)

A

Select ANY items to fill bins as much as possible.

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

Lower bound (C1)

A

Sum of values / bin size

Allows you to determine what the minimum no. of bins needed and thus whether your answer is optimal.

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

Order (a.k.a complexity) of an Algorithm (C1)

A

Identifies how changes in the size of a problem affects the approximate run time of the algorithm.

e.g. Bubble sort = Quadratic Order

Linear order = n
Quadratic order = n^2
Cubic order = n^3

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

Vertex (node) (C2)

A

A point on a graph connected by edges. (a.k.a node)

A ist of vertices is sometimes called the vertex set.

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

Edge (arc) (C2)

A

A line segment connecting vertices. (a.k.a arc)

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

Subgraph (C2)

A

A graph of which the vertices belong to another bigger graph.

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

Degree/Valency/Order (C2)

A

The number of edges incident to a vertex.

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

Walk (C2)

A

A route through a graph along edges going from one vertex to the next.

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

Path (C2)

A

A walk in which no vertex is visited more than once.

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

Trail (C2)

A

A walk in which no edge is visited more than once.

17
Q

Cycle (C2)

A

A walk in which the end vertex is the same as the start vertex.
(And no vertex is visited more than once)

18
Q

Hamiltonian Cycle (C2)

A

A cycle including every vertex within it.

19
Q

Connected Graph (C2)

A

All vertices are connected to at least one other vertex.

20
Q

Loop (C2)

A

An edge/arc that starts and finishes at the same vertex.

21
Q

Simple Graph (C2)

A

One in which there are no loops & at most one edge is connecting to any pair of vertices.

22
Q

Directed Edges (C2)

A

Edges which have a specific direction associated with them

23
Q

Undirected Graph (C2)

A

Edges have no direction.

Sum of degrees of vertices = 2 x no. of edges

Thus the number of odd vertices must be even -
Euler’s handshaking lemma.

24
Q

Tree (C2)

A

A connected graph with no cycles.

25
Q

Spanning Tree (C2)

A

A subgraph which includes all vertices of the original graph and is a tree.

26
Q

Complete Graph (C2)

A

A graph in which every vertex is directly connected by a single edge to each of the other vertices.

27
Q

Isomorphic Graphs (C2)

A

Graphs which show the same information but are drawn differently.

28
Q

Adjacency Matrix (C2)

A

Each entry describes the number of arcs joining the corresponding vertices.
(Square table which is symmetrical)

29
Q

Distance Matrix (C2)

A

The matrix associated with a weighted graph and so the entries represent the weight of each arc, no the no. of arcs.

30
Q

Minimum Spanning Tree (C3)

A

A spanning tree such that the total length of its arcs is as small as possible.

31
Q

Kruskal’s Algorithm (C3)

A

Used to find MST
- Sort edges into ascending order of weight
- Select arc of least weight to start the tree
- Select next arc of least weight which DOESN’T form a cycle.
- Repeat until all vertices are connected

32
Q

Prim’s Algorithm (C3)

A

Used to find MST
- Choose any vertex to start
- Select an adjoining arc of least weight that connects to a vertex not yet in the tree
- Repeat until all vertices are connected

33
Q

Prim’s => Distance Matrix (C3)

A
  • Choose any vertex to start
  • Delete the row of the vertex
  • Circle the lowest undeleted entry in the column
  • Move to the corresponding column of the circled no.
  • Repeat the process for each circled number
34
Q

Dijkstra’s Algorithm

A

Used to find shortest path between two vertices in a network.

Uses…
Vertex | Label Ord | Final Label
Working Values

35
Q

FLOYD’s?

A
36
Q
A