Pergunta de entrevista da empresa Apple

C++ polymorphism and overloading. Find connected components from a binary image.