Question: Programming Project 1 4 . 1 2 . 7 : . In a paint program, a flood fill fills all empty pixels of a drawing

Programming Project 14.12.7: .In a paint program, a flood fill fills all empty pixels of a drawing with a given color, stopping when it reaches occupied pixels. In this exercise, you will implement a simple variation of this algorithm, flood-filling a 10\times 10 array of integers that are initially 0. Prompt for the starting row and column.
Push the (row, column) pair on a stack.
You will need to provide a simple Pair class.
Repeat the following operations until the stack is empty:
Pop off the (row, column) pair from the top of the stack.
If it has not yet been filled, fill th corresponding array location with numbers 1,2,3, and so on (to show the order in which the square is filled.)
Push the coordinates of any unfilled neighbors in the north, east, south, or west direction on the stack.
When you are done, print the entire array.
Programming Project 14.12.8: .
Repeat Programming Project 14.12.7, but use a queue instead.
here is the work that is done but not sure where to change queue
Please use C++.
I'm trying to do 14.12.8

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 Accounting Questions!