Question: Q4) Using the following Algorithm to fill the shape: (5) Flood-fill (node, target-color, replacement-color): 1. If target-color is equal to replacement-color, return 2. If the

 Q4) Using the following Algorithm to fill the shape: (5) Flood-fill

Q4) Using the following Algorithm to fill the shape: (5) Flood-fill (node, target-color, replacement-color): 1. If target-color is equal to replacement-color, return 2. If the color of node is not equal to target-color, return. 3. Set the color of node to replacement-color 4. Perform Flood-fill (one step to the south of node, target-color replacement-colon Perform Flood-fill (one step to the north of node, target-color, replacement-color) Perform Flood-fill (one step to the west of node, target-color, replacement-colon Perform Flood-fill (one step to the east of node, target-color, replacement-colon) 5. Return 1 Q4) Using the following Algorithm to fill the shape: (5) Flood-fill (node, target-color, replacement-color): 1. If target-color is equal to replacement-color, return 2. If the color of node is not equal to target-color, return. 3. Set the color of node to replacement-color 4. Perform Flood-fill (one step to the south of node, target-color replacement-colon Perform Flood-fill (one step to the north of node, target-color, replacement-color) Perform Flood-fill (one step to the west of node, target-color, replacement-colon Perform Flood-fill (one step to the east of node, target-color, replacement-colon) 5. Return 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!