Well that explains that. I think I have the timeout feature figured out. Thanks for all of your help yet again.
Type: Posts; User: waltershc
Well that explains that. I think I have the timeout feature figured out. Thanks for all of your help yet again.
I have not. I input the loop counter into my code and now it shows that it works AND completes rather quickly. Here is the new code with the counter.
//algorthm 1
//cubic maximum...
I think it is freezing because I have a pretty stout computer and left it for a few hours and didn't receive anything back. Either way, I will add that line to my code when I get out of class. ...
Okay, I will play around with that.
One final thing, my instructor just told me to just add some time that 'times out' when the program gets stuck for more than 10 minutes. I would need to encase...
I added in some code to print to console as the 3rd set of algorithms execute and it turns out the 3rd and 4th algorithms are working properly. It is the 1st and 2nd that are hanging it up. Where...
I moved everything into one class and now the program is partially working. The algorithms run on the 10.txt file in 0 nanoseconds; all three times. Idk if that is normal or not. The algorithms...
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method maxSubSum1(int[]) is undefined for the type driver
The method maxSubSum2(int[]) is undefined for the type...
It's not running when I call the algorithm methods. I get a 'this method [insert algorithm method here] is undefined for type driver.'
figured it out using common sense and also using your suggestion to close scanners that are no longer needed. let me do some more poking with my main class and I will come back with any questions. ...
I do not believe I am closing the files as I have no idea what you are talking about.
edit- norm, please note i also just updated my driver class with a more final approach.
import java.io.IOException;
public class driver {
public static void main(String[] args) throws IOException{
long startTime, endTime, average;
System.out.println("Started.");
I am trying to code my program to populate three different text files with randomly generated integers. The amount of integers in the text files are 10, 10 000, and 1 000 000. So the 'ten.txt' file...