sorting question...
in
Programming Questions
•
3 years ago
Hi...
Imagine something like that:
- int[] n = new int [4];
- String[] names = { "Augusto","Christofer","Erick","Victor",
- };
- for (int i = 0; i < n.length; i++){
- n[i] = int(random(2,10));
- print(n[i]+", ");
- }
for exemple:
n[0] = 5; names[0] = "Augusto";
n[1] = 3; names[1] = "
Christofer";
n[2] = 7; names[2] = "Erick";
n[3] = 9; names[3] = "Victor";
after sorting the array n[]
n[0] = 3; names[0] = "Christofer";
n[1] = 5; names[1] = "Augusto";
n[2] = 7; names[2] = "Erick";
n[3] = 9; names[3] = "Victor";
There is a
n easy way to do this?
Thanks
1