c - Find the largest rectangle with no repeated elements -


find max size of rectangular contiguous submatrix of unique (i.e. non repeated within given submatrix) element.

how can solve this?

you should set maximum value 0. iterate rows of matrix , if not repeating (whatever means), compare size maximum. if bigger, store new maximum value , use further iterations. in case found new maximum, store whatever need store. so, algorithm looks this:

maximum <- 0 rows row     if (row not repeating)         if (row rectangle size > maximum)             maximum <- new maximum             store whatever need store         end if     end if end 

note, if not have further information, pointless binary search, since have check size of each rectangle. if have further knowledge rectangles, algorithm might optimized.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -