Mind map
DECISION 1
Map content
DECISION 1
ALGORITHMS
- Stopping condition - an instruction that tells you to stop at a certain point.
- In flow charts: ovals = start/stop, rectangle = instruction, diamond = decision.
SORTING ALGORITHMS
- Bubble - first two, then next two, underline at end of pass. Finish when no more swaps.
- Shuttle - first pair, next pair, if swapped work backwards.
- Shell - n/2 subsets.
- Quick sort - use 1st number as a pivot and compare, stop when every number has been a pivot.
- Bubble and shuttle: max comparisons = n(n-1) / 2
GRAPHS
- Hamiltonian cycle goes through every vertex once before returning to start.
- Eulerian cycle goes through every edge once (all even degrees).
- sum of degrees is double number of edges (always even).
- For n vertices, no. of hamiltonian cycles = (n-1)!/2
PRIM'S / KRUSKAL'S
- For n vertices, no, of edges = n-1.
- Disadvantages of Kruskal's: difficult to use in matrix form, slow as have to check for cycles.
DIJKSTRA'S
- Limitation - doesn't work with -ve weights.
CHINESE POSTMAN
- If starts and finishes as same place - Eulerian, use standard algorithm.
- If start in different place to finish - semi-Eulerian, choose shortest weight between two given odd vertices.
- If start and finish anywhere - choose shortest weight between any odd vertices.
TRAVELLING SALESMAN
- Nearest neighbour = upper bound.
- Deleting edges = lower bound.
- May have to add edges to make graph complete.
- Think about how appropriate range or answers are in the context/ given info.
Information
- Description
- Mind Map on DECISION 1, created by Gregor Forrest on 15/06/2016.
- Created by
- Gregor Forrest
- Views
- 0
- Rating