Data Structures, Algorithms, & Applications in Java
Chapter 10, Exercise 17

You can use a stack in the image component labeling problem. This will not affect the outcome. In the remaining applications, correctness is affected.