Tell me more ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Suppose there is a n*n bitmap. Each of the pixel in bitmap can only be black or white, and initially they are all white.

Someone is coloring the bitmap one pixel each time.
Our goal is to get the maximum number of connected pixels in that bitmap, each time after someone colored a pixel.

The connected pixel is 4-pixel (north, west, east, south) instead of 8-pixel (all the pixels around).

How to design an algorithm with least amortized cost and worst-case running time?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.