AA step back takes a place off the stack, and is no look.
BA queue's length changes what is waiting, not how many looks there are.
DOnly breadth-first's numbers are fewest roads. Depth-first's say the order reached.
4question 4
The walk starts at the place after the semicolon on each map. On which map does it make the most looks?
the answer, and why
the answer is A
A-B, B-C, C-D, A-E, B-F is in one piece with 5 roads, 10 looks. A-B, B-C, C-G has 3 roads, 6 looks, and A-B, A-E, A-F, E-F 4 roads, 8.
if you chose another
B3 roads, 6 looks.
C4 roads, 8 looks.
DIt has 6 roads, but E's piece holds only E-F, so the walk makes 2 looks.
pen and paper
5question 5about 8 minutes
The map A-B, A-E, C-D and F-G is in three pieces. The walk starts at E.
Write the stack after each place goes on or comes off.
What number does each place get?
How would you number C, D, F and G too, and how many looks do all the walks make?
a hint
E has one road, to A. Places on the other pieces are never reached from E.
a worked answer
Stacks, bottom first: E; then E, A; then E, A, B; then E, A; then E; then empty. E is 1, A 2, B 3. C, D, F and G get no number from this walk. Start a new walk at C, numbering from 1: C 1, D 2. Then another at F: F 1, G 2. Three walks, three pieces. Each of the 4 roads gets 2 looks, 8 looks in all.
Each place shows its letter and its number. The new walks, from C and from F, number the shaded pieces.
A map is a line of places, each joined by a road to the next. The walk starts at one end.
How many places are on the stack when it reaches the far end?
How many times does it step back?
Why does it make looks?
a hint
Nothing comes off before the far end. Then use the degrees.
a worked answer
Nothing comes off before the far end, so all are on the stack. Then each comes off in turn, and every one but the start steps back to the place below: step backs. Each place looks along all its roads, so each of the roads gets 2 looks. Twice is .
Why does a line of places make looks?3 of 3 shown
1the move: a line's roads
the line:
why it is allowed: The first place needs no road, and each place after it adds one.
2the move: twice each road
the line:
why it is allowed: is the looks. Every place comes off with no road left, so each of line 1's roads is looked along from both ends.
guess it, then
3the move: add the twos
the line:
why it is allowed: twos make twice . For 5 places, 8.
guess it, then
try it with a small : at , line 2 gives , which you can work out by hand