Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CHRTRAN and remove characters
Message
 
 
To
14/10/2004 13:12:51
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00950654
Message ID:
00951482
Views:
6
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform