Hi readers, I can sort a single array, using the bubble sort method, but I can't sort, the elements of another array.
eg
array1[]={4, 3, 7, 5, 1, 5, 8, 7}
array2[]=[23, 67, 98, 56, 56, 67, 77, 78]
If i sort array1[] i get
my array1 = 1, 3, 4, 5, 5, 7, 7, 8
but my
array2 = 23, 67, 98, 56, 56, 67, 77, 78
how do i swap the elements of array2 so it prints corresponding to the array1 which is sorted.
eg
array1[]={4, 3, 7, 5, 1, 5, 8, 7}
array2[]=[23, 67, 98, 56, 56, 67, 77, 78]
If i sort array1[] i get
my array1 = 1, 3, 4, 5, 5, 7, 7, 8
but my
array2 = 23, 67, 98, 56, 56, 67, 77, 78
how do i swap the elements of array2 so it prints corresponding to the array1 which is sorted.
Comment