السلام عليكم :)
هذا مثال كامل على ترتيب المصفوفات الرقمية و مصفوفات الكلمات... و ترتيبها من الاصغر الى الاكبر ...
import java.util.*;
public class ArrayUtil{
public static void swap(String[] a, int i, int j){
String temp = a;
a = a[j];
a[j] = temp;
}
public static void swap(int[] b, int i, int j){
int temp = b;
b = b[j];
b[j] = temp;
}
public static void print(String[] a){
for(int i = 0; i B){
for(int i = 0; i < b.length; i++)
System.out.print(b + " ");
System.out.println();
}
}
class InsertSortString{
public static void sort(String[] a){
String current;
int i, j;
for(i = 1; i < a.length; i++){
current = a;
for(j = i; j > 0 && current.compareTo(a[j - 1]) B){
int current, i, j;
for(i = 1; i < b.length; i++){
current = b;
for(j = i; j > 0 && current B);
InsertSortInt.sort(B);
ArrayUtil.print(B);
}
}و اي سؤال عندك، تقدر تطرحه بالموضوع