This content has been marked as final. Show 5 replies
R.S. wrote:Where did this 1033 come from? Could you explain your problem in a bit more detail and also post what you have done so far and explain where you are stuck: only posting the problem description sound a bit like "can some one do it for me", it's better to ask a specific question here.
Hi, I'm new here and I'm having trouble.
I have to write a java application which uses recursion to find the maximal contiguous sum in a list of integers.
The input is read from a text file where each line represents a list containing the following integers:
For example, it might contain
7 -2 -4 30 15 -7 -5 1000
2 -50 100
6 1000 -2000 900 2800 -2900 2801
4 100 -10 5 8
4 100 -50 5 8
And for the output, for each line of data read, I have to display the largest sum of consecutive integers in the list followed by the list itself. For example for the lists above, my output would be:
(on the left side is the largest sum of consecutive integers and on the right is the list of integers)
R.S. wrote:You can edit your posts, as long as nobody has responded to them yet.
I'm sorry about that. I didn't mean to double post. I accidently clicked "post" before I finished typing.
Also, as a basic courtesy, if for some reason you needed to abandon a thread and start a new one, you should add a note to that effect in the first thread with a link to the other one.