Nov 10, 2009 at 11:27pm UTC
Give me an example of an bidimensional table that could arrange the elements of each column in increasing order.
(1)
1 4 5 6
8 5 4 9
1 2 7 4
2 3 6 1
(2)
1 2 4 1
1 3 5 4
2 4 6 6
8 5 7 9
Something like this ,from nr(1) to obtain the 2nd
Last edited on Nov 11, 2009 at 11:04pm UTC
Nov 11, 2009 at 12:58am UTC
If you can be more specific about how you are sorting this 2 dimensional array, what kind of data is in it..and what exacting you are trying to do and having a problem with maybe we can help you then.
Nov 11, 2009 at 9:57am UTC
it is given this bidimensional massive X[20][20],and I have to arrange in increasing order the elements of each column.
Nov 11, 2009 at 11:00am UTC
write a sort function which given an array sort it in-place.
now run a look till i=0 to i=columns and send the data to the sort function.
lets say:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
void sort(int **array, int column_length)
{
//implementation
//sort *(array + 0) to *(array + column_length)
}
void main()
{
int array[][];
for (int i =0; i < row_length;i++)
{
sort((array+i),column_length);
}
}
something like this can be implemented.
Last edited on Nov 11, 2009 at 11:01am UTC