Question: Write a function (as pseudo code) that gets a matrix of colors, and a starting point, and colors the white area connected to the starting
Write a function (as pseudo code) that gets a matrix of colors, and a starting point, and colors the white area connected to the starting pint with RED.
See examples below:
The green point on the left represents the starting point.
The red points are the area containing the starting point.
For the pseudo code you may use colors by writing, e.g., BLACK, WHITE, RED. For example:
If
![A[i) == WHITE A[i]) = RED %3D](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/630793286ae52_80863079328560a4.jpg)
Use recursion.
![A[i] == WHITE ADD] =RED](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/08/63079328de6b9_80863079328c79db.jpg)
A[i] == WHITE ADD] =RED
Step by Step Solution
3.46 Rating (153 Votes )
There are 3 Steps involved in it
To solve this problem using recursion you can use a flood fill algorithm Heres a pseudo code to colo... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
6095fdffb8fb0_26481.pdf
180 KBs PDF File
6095fdffb8fb0_26481.docx
120 KBs Word File
