Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CHRTRAN and remove characters
Message
 
 
À
14/10/2004 13:12:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00950654
Message ID:
00951482
Vues:
7
Fabio,

>VFP CHRTRAN, when don't remove character, don't use a O(n)
>( because this not exist ), but it use a O(n*m) program.

Sorry, to disrupt your belief, but it can be done O(n) without regard to the length of the second and third arguments (assuming that is what the m means in your above calculation). A simple 256 character transformation matrix can be constructed, where the input character is used as an index into the matrix to get the output character. The translation line in the C++ code would look like this then:
  *cpOut++ = XLatMatrix[*cpIn]; // translate the character and advance the output pointer
>Any developer, with a little backgroud, known that this task can to be make
>in O((n+m)*Log(min(n,m))).

So I guess that makes me a little better than any developer with a little background. *bg*
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform