Word Wrapping Problem

Hi guys,

This is my post in java forum after 2 years. :)

I've come across this problem of writing a program which solves this problem:

This is a notepad application and I'm supposed to write a program for Word wrap problem:

The width of notepad is fixed (call it y

character), there's a lits of n

words to be fixed in this notepad. Any word can't be greater than length x

.

Now say the space left at the right hand side in a line i

in our notepad is Si

.

I've to write a code which minimizes summation(cube(Si))

for all i

.

[617 byte] By [ankit_naranga] at [2007-10-2 9:45:44]
# 1
I think this can be done using dynamic programming.Please helpThanks
ankit_naranga at 2007-7-16 23:51:14 > top of Java-index,Other Topics,Algorithms...
# 2
There are already components that do this. Why reinvent the wheel?
dubwaia at 2007-7-16 23:51:14 > top of Java-index,Other Topics,Algorithms...