Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CHRTRAN and remove characters
Message
From
14/10/2004 14:27:49
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00950654
Message ID:
00951497
Views:
5
>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*

See SYS(15).
This is writted on Message #951329.

This technique it is valid for a short second string, not in general cases.

End.
Previous
Reply
Map
View

Click here to load this message in the networking platform