Results 1 to 3 of 3
- 02-13-2012, 12:42 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 2
- Rep Power
- 0
How to update rows in 2 D arrays?
I have a two dimensional array which has the initial set of data and then I have an ArrayList of Integers which has some of the rows of the two dimensional arrays .And the indexes of the rows which were copied from the two dimensional array are stored in another ArrayList. The new set of ArrayList of Integers was modified and now I want to update these rows in the original 2 D array.
This is the code I used :
Java Code:static void update_new_pop(int [][]new_pop, ArrayList<int[]> crossover_population, ArrayList<Integer> crossover_pop_index,int pop_size,int size_crossover_pop_index,int m){ for(int iterRow = 0,j=0;iterRow<pop_size;iterRow++) { if(j<size_crossover_pop_index){ if(iterRow == crossover_pop_index.get(j)){ new_pop[iterRow]=crossover_population.get(j); j++; } } } for(int iterRow = 0;iterRow<pop_size;iterRow++){ System.out.println("array["+iterRow+"]:"); for(int iterCol=0;iterCol<m;iterCol++){ System.out.print(+new_pop[iterRow][iterCol]); } System.out.println(); } }
- 02-13-2012, 01:37 AM #2
Re: How to update rows in 2 D arrays?
You don't say if you have a problem or what the problem is.
Can you explain?
You need to define several variables that are used in the code you posted if you want anyone to make sense of it.
- 02-13-2012, 06:38 AM #3
Re: How to update rows in 2 D arrays?
udayjava, you should continue the discussion in the thread you started yesterday rather than post a new, obviously related question. Or did you plan to clutter the forum with threads you never return to? That's not going to happen.
I'm closing this thread.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Jtable rows
By riddhishah28 in forum AWT / SwingReplies: 3Last Post: 02-18-2011, 06:24 AM -
jxl repeating rows
By mermaid in forum New To JavaReplies: 0Last Post: 01-14-2011, 03:59 PM -
Arrays.sort... why sorting all arrays in class?
By innspiron in forum New To JavaReplies: 6Last Post: 03-23-2010, 01:40 AM -
How to Update newly inserted rows in the Excel through Java..Pls help..Explained well
By josephkarthic in forum New To JavaReplies: 2Last Post: 03-16-2010, 08:24 PM -
How to get the no. of rows in a resultset
By baskar.nitt in forum New To JavaReplies: 5Last Post: 09-19-2008, 01:30 PM


LinkBack URL
About LinkBacks

Bookmarks