C Program Maintains 2 D Grid Array Objects Object Keeps Track Two Values Image Component L Q37026254

Your C++ program maintains a 2-D grid (array) of objects, whereeach object keeps track of two values, the image component label(to be assigned by DFS or BFS), and the order in which the pixelwas discovered, which depends on the search strategy (DFS or BFS).Accordingly, each pixel is represented by an object thatencapsulates a label (component label: 2, 3, 4, …) and (order ofdiscovery: 1, 2, 3, …).

How do we make pixel as an object? Like, I know that I need tomake a class, but how would I make pixel as an object. The gridwhen generated should look like the picture

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.