Now for part B, the question is slightly different. We again have to format text using the 72-80 characters format described above (and given the same type of input) but this time, we are required to maximize the number of lines ending with the letter r. I know that this requires a table and we are to fill in this table dynamically. However, this is where I'm stuck. I know that the entry to a certain cell in the table xould be something along the lines of max{word_included_on_same_line, word_added_to_the_next_line} ... but no matter what I try to do with the table, I can't seem to derive a formula to fill it in (in order to maximize the number of lines ending with the letter r). Note that we do note have to maximize the overall number of lines, but simply the number of lines ending with r.
Any help would be really appreciated.. I've been stuck on this last question for severeal days, and now I'm running out of time
Thanks - L.N
This post has been edited by LivingNightmare: 12 July 2010 - 07:29 PM

New Topic/Question
Reply


MultiQuote





|