No history yet

Final Exam

 

1.In the context of the Flood Fill algorithm, how is a digital image typically represented?

 

2.When using the 'Paint Bucket' tool, the color you click on to start the fill is known as the __________.

 

3.What is the primary role of a 'base case' in a recursive function?

 

4.Which of the following C++ if statements correctly checks if a coordinate (x, y) is outside the boundaries of a grid with width and height?

 

5.In a recursive Flood Fill implementation, after a pixel's color is changed, what is the next logical step?

 

6.What is a 'Stack Overflow' error in the context of a recursive algorithm?

 

7.The concept of 'connectivity' in Flood Fill determines which adjacent pixels are considered neighbors.

 

8.In a 2D array representing an image, the coordinate (0, 0) typically refers to which pixel?

 

9.An 8-way connectivity check considers more neighbors than a 4-way check.

 

10.Why is the iterative (queue-based) approach often preferred over recursion for Flood Fill in professional applications?

 

11.A simplified analogy for a function call stack is a stack of plates: the last plate you add is the first one you remove.

 

12.In a C++ flood fill function, which of these is NOT a valid base case for stopping the recursion at a given pixel?

All done? Get your grade