posted 23 years ago
If we have the following two arrays,we need to treat them as two colunms.
int x[]=new int[]{1, 2, 2, 3, 5, 8, 99, 2};
char y[]=new char[]{'h','c','a','b','t','p','m','n'}
i need to sort them based on values in array x and i will get the following:
int x[]= new int[]{1, 2, 2, 2, 3, 5, 8, 99}
char y[]=new char[]]{'h','c','a','n','b','t','p','m'}
then i need to sort charatcers associated with every group of 2s
as :
int x[]= new int[]{1, 2, 2, 2, 3, 5, 8, 99}
char y[]=new char[]]{'h','a','c','n','b','t','p','m'}
when i say the characters associated with the 2 i mean c,a,n
i need them to be in this order a,c,n...
Thanks for your help.