For N = 100, the number of iteration depends on the ratio: it could be
anywhere from 19 (10x10-1) to 100 iterations (worst case happens if the
output is a single line or a single column). So that would make N
iterations (in worst cases) and ~2*SQRT(N)-1 best case.
It occurs to me that these cases could be cleared up with a fairly small
revision to the algorithm: when calculating initial values of rows and cols,
take into account the ratio: (using your code)
if (width<height) {
var cols:Number = 1;
var rows:Number = Math.floor(height/width)
} else {
var rows:Number = 1;
var cols:Number = Math.floor(width/height)
}
Danny
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com