hw6 - CS 473 Homework 6 (due March 16, 2010) Spring 2010 CS...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 473 Homework 6 (due March 16, 2010) Spring 2010 CS 473: Undergraduate Algorithms, Spring 2010 Homework 6 Written solutions due Tuesday, March 16, 2010 at noon 1. (a) Describe and analyze an algorithm to compute the size of the largest connected component of black pixels in an n n bitmap B [ 1 .. n ,1 .. n ] . For example, given the bitmap below as input, your algorithm should return the number 9, because the largest conected black component (marked with white dots on the right) contains nine pixels. 9 (b) Design and analyze an algorithm B LACKEN ( i , j ) that colors the pixel B [ i , j ] black and returns the size of the largest black component in the bitmap. For full credit, the amortized running time of your algorithm (starting with an all-white bitmap) must be as small as possible. For example, at each step in the sequence below, we blacken the pixel marked with an X . The largest black component is marked with white dots; the number underneath shows the correct output of the B LACKEN algorithm.LACKEN algorithm....
View Full Document

Page1 / 2

hw6 - CS 473 Homework 6 (due March 16, 2010) Spring 2010 CS...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online