Transcript PPTX
Flood insurance
© 2015 JP Cohoon
Photo: Wikipedia – Flood waters threaten Minot, ND
Flood insurance
•
•
•
•
Set brush color to c
Color location s on the drawing
Create a TODO list
Add s to the TODO list
•
While the TODO list is not empty
– Coordinate v = head of TODO list
– Remove v from TODO List
–
–
–
–
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Example
Flood drawing starting at s using c
Flood drawing starting at s using c
s (7,7)
c
Paint s
s (7,7)
c
Create TODO list
s (7,7)
c
TODO list
•
Add s to TODO list
s (7,7)
c
TODO list
• (7,7)
Loop while TODO list is not empty
s (7,7)
c
TODO list
• (7,7)
Loop while TODO list is not empty
s (7,7)
c
TODO list
• (7,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (7,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
•
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
•
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
• (8,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
• (8,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
• (8,7)
• (7,6)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
• (8,7)
• (7,6)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,7)
TODO list
• (6,7)
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (6,7)
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
• (6,6)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
• (6,6)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (8,7)
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,7)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,6)
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,6)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,8)
TODO list
• (7,8)
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,8)
TODO list
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,8)
TODO list
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,8)
TODO list
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,6)
TODO list
• (6,6)
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,6)
TODO list
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,6)
TODO list
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,6)
TODO list
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,6)
TODO list
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,8)
TODO list
• (6,8)
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,8)
TODO list
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,8)
TODO list
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,8)
TODO list
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,8)
TODO list
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (9,7)
TODO list
• (9,7)
• (8,6)
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (9,7)
TODO list
• (8,6)
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,6)
TODO list
• (8,6)
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,6)
TODO list
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,8)
TODO list
• (8,8)
• (7,5)
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (8,8)
TODO list
• (7,5)
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,5)
TODO list
• (7,5)
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (7,5)
TODO list
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,5)
TODO list
• (6,5)
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,5)
TODO list
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (5,8)
TODO list
• (5,8)
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (5,8)
TODO list
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
• (4,8)
• (5,9)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,9)
TODO list
• (6,9)
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
• (4,8)
• (5,9)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (6,9)
TODO list
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
• (4,8)
• (5,9)
• (6,10)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (10,7)
TODO list
• (10,7)
• (9,6)
• (9,8)
• (8,5)
• (7,4)
• (4,8)
• (5,9)
• (6,10)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
Loop while TODO list is not empty
s (7,7)
c
v (10,7)
v = head of TODO list
Remove v from TODO List
If v’s left is empty, paint it and add to TODO list
If v’s right is empty, paint it and add to TODO list
If v’s above is empty, paint it and add to TODO list
If v’s below is empty, paint it and add to TODO list
TODO list
• (9,6)
• (9,8)
• (8,5)
• (7,4)
• (4,8)
• (5,9)
• (6,10)
• (11,7)
• (10,6)
• (10,8)