Professional Documents
Culture Documents
D1 Common Word Questions Answers
D1 Common Word Questions Answers
1. Which number is in the correct position after the first pass of a bubble sort?
2. Explain how to complete a bubble sort, sorting numbers into ascending order.
3. What is the maximum number of passes needed to sort a list of 10 numbers using a bubble sort?
4. What is the maximum number of passes needed to sort a list of n numbers using a bubble sort?
n–1
5. What is the maximum number of iterations needed to sort a list of 10 numbers using a quick sort?
10
6. What is the maximum number of iterations needed to find an item in a list of 10 items using a binary search?
7. What is the maximum number of iterations needed to find an item in a list of 205 items using a binary search?
8
Prims, Kruskals and Dijkstras
Prims you add new nodes, Kruskals you add new arcs
Kruskals you can add given arcs on to start, but Prims you can’t.
2. If a network has 7 nodes, what is the minimum number of arcs that are needed to make a spanning tree
connecting all the nodes?
3. If a network has N nodes, what is the minimum number of arcs that are needed to make a spanning tree
connecting all the nodes?
N–1
4. In a network of towns, town A and B have already been connected. Would you use Kruskals or Prims to find the
minimum spanning tree including the arc AB. Explain how you would use your chosen algorithm.
5. Explain how you obtain the shortest path once you have filled in the numbers in the boxes for Dijkstras’.
Working backwards
Eg. From F to E: 5 – 3 = 2
Chinese Postman/Route Inspection
1. If the question states ‘use the route inspection algorithm’, what does this mean?
2. If you are allowed to start and finish at different nodes, what does this mean about the valencies of the nodes?
3. If you can start and finish at different nodes, explain why you should start at a node with odd valency.
If you start at an odd node, then you must then finish at the other odd node in the network (as there are always an
even number of odd nodes).
Therefore this removes the need to join these 2 odd nodes to make the route possible. (If you started somewhere
else you would have to repeat arcs to be able to draw the picture)
4. Explain why a network cannot have an odd number of vertices of odd valency.
Therefore if you have an odd number of nodes with an odd valency, the total would be odd, which is impossible.
5. If the total valency of all the nodes in a network is m, how many arcs are in the network?
m/2
Critical Path
If two events have the same starting node, to be defined uniquely, they must have different end nodes.
When 2 activities do not rely on the same preceding activities. For example, if one activity depends on A but another
depends on A and B
2. What calculation do you do in order to work out the float for an activity?
1. In every real life problem there are 2 inequalities that apply. What are the 2 inequalities?
x ≥ 0 and y ≥ 0
2. What are the differences and similarities between the objective line method and the vertex testing method?
Objective line you only have to find the coordinate of 1 vertex, whereas in point testing you have to find the
coordinates of all the vertices.
Objective line you do not have to test the points in the Objective Function, whereas in point testing you do.
Matchings
When there are two nodes from each set that are unmatched.
2. What are the 2 reasons that it may be impossible to get a complete matching?
Complete matching is when all the nodes from one set are paired with all the nodes from another set.