Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Computer science degree and Foxpro
Message
De
25/07/1999 13:38:09
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
22/07/1999 21:24:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00243740
Message ID:
00245869
Vues:
19
Hey Paul.

source[1]=10
source[2]=5
source[3]=8
source[4]=1
source[5]=9
source[6]=2
source[7]=6
source[8]=7
source[9]=3
source[10]=4

for i=1 to 10
sorted[source[i]] = source[i]
endfor

so sorted[10] becomes the value of source[1] and sorted[5] gets the value of source[2] etc.

What is amazing about this branch of this topic is the semantics. The code takes an unsorted list of numbers and produced a sorted list of numbers. It does this with only one pass through the source list. Its not possible to argue that this is not the fastest possible sort (unless your a lawyer).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform