Sorting Test Algorithm