Norman Radder

Ranch Hand
+ Follow
since Jan 07, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Norman Radder

Did you try the code with a larger number like 2000 (instead of 100)?
7 years ago

 the two thread to start at the same time,


That is very hard to do.  Most programs execute one statement at a time.  For two statements to be executed at the same time would require that each statement be executed on a separate processor.
That's possible but hard to do.
7 years ago
Some suggestions for debugging the code:
change the size to 3 from 10 so there is less print out to go through
add a simple String to load the array with to make it easier to see what happens: "123456789"
Use the Arrays class's deepToString() method to format the matrix for debugging printing
7 years ago
Is the problem in the swapMatrix method?  

Can you explain the logic of what that method is doing?
7 years ago
How are you debugging the code to see where it is going wrong?  I use print statement to print out the values of variables as there values are changed.
7 years ago

the code that I have so far isn't working correctly and does not continue moving columns until all variations are met.


Could you post a small example of the output that shows the problem?

For example, given a 3x3 array:
123
456
789
Swapping 1st and 2nd columns should give
213
546
879
But the program gives
113
446
779
The first two columns are the same
7 years ago
With the larger number the two totals are often not the same.
7 years ago

What have i to do to , to make this code works ?


Please explain what "works" means?


To see different results, use a larger number for the counting: for example 1000 vs 100
7 years ago
The code in post#1 would never compile or execute because the method called on line 12 does not exist.
7 years ago

a slip of the fingers


Are you saying the code posted here was not copied and pasted from the original code you have on your PC, but was entered separately with possible changes in its contents?
7 years ago
All these comments and nothing about the compiler error re the method defined on line 2 and the method called on line 12 having different names.
7 years ago
Try using the javac compiler program to get a better error message that shows what the problem is.
7 years ago

there are compiler errors  


You need to post the code and its errors if you want help.
7 years ago
I prefer working on one problem at a time.  I thought the current problem was sorting a 2 dim ArrayList of doubles.  Have you tried creating a small program of 20-30 lines that defines a 2 dim ArrayList and sorts it on different columns?  Get that to work, then merge the code into the larger program and move to the next problem.
7 years ago
It is easier to work on a small program that tests only the problem you are working on.  For this problem about 25 lines of  code should be enough.
7 years ago