Further Decision Flashcards
Trace Table (C1)
Used to record values of each variable as the algorithm
e.g.
- Instruction Step
- n
- A
- B
- C
- Print
Flow Charts (C1)
Stretched Circle - Start/End
Rectangle - Instruction
Rhombus - Decision (question)
Bubble Sort (C1)
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.
Quick Sort (C1)
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.
First-Fit Algorithm (C1)
Consider items in order given - fitting into first bin possible.
First-Fit DECREASING Algorithm (C1)
Same as FF but first sort items into descending value before applying the algorithm.
(Fit into first bin possible)
Full-bin packing (C1)
Select ANY items to fill bins as much as possible.
Lower bound (C1)
Sum of values / bin size
Allows you to determine what the minimum no. of bins needed and thus whether your answer is optimal.
Order (a.k.a complexity) of an Algorithm (C1)
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
Vertex (node) (C2)
A point on a graph connected by edges. (a.k.a node)
A ist of vertices is sometimes called the vertex set.
Edge (arc) (C2)
A line segment connecting vertices. (a.k.a arc)
Subgraph (C2)
A graph of which the vertices belong to another bigger graph.
Degree/Valency/Order (C2)
The number of edges incident to a vertex.
Walk (C2)
A route through a graph along edges going from one vertex to the next.
Path (C2)
A walk in which no vertex is visited more than once.