of the flood-fill algorithm using the image shown in Fig. 2.21 and starting at coordinates (5,1).
2.The implementation of the flood-fill algorithm in Prog. 2.1 places all theneighboring pixels of each visited pixel into either thestackor thequeuewithout ensuring they are foreground pixels and that they lie within theimage boundaries. The number of items in the stack or the queue can bereduced by ignoring (not inserting) those neighboring pixels that do not
meet the two conditions given above. Modify thedepth-firstandbreadth firstvariants given in Prog. 2.1 accordingly and compare the new runningtimes.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here