Win a copy of Rust Web Development this week in the Other Languages forum!

Norman Radder

Ranch Hand
+ Follow
since Jan 07, 2017
Cows and Likes
Cows
Total received
4
In last 30 days
0
Total given
0
Likes
Total received
17
Received in last 30 days
0
Total given
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Norman Radder

Did you try the code with a larger number like 2000 (instead of 100)?
4 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.
4 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
4 years ago
Is the problem in the swapMatrix method?  

Can you explain the logic of what that method is doing?
4 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.
4 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
4 years ago
With the larger number the two totals are often not the same.
4 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
4 years ago
The code in post#1 would never compile or execute because the method called on line 12 does not exist.
4 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?
4 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.
4 years ago
Try using the javac compiler program to get a better error message that shows what the problem is.
4 years ago

there are compiler errors  


You need to post the code and its errors if you want help.
4 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.
4 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.
4 years ago