Jump to content
  • Advertisement
Sign in to follow this  
random_thinker

c++ : std::string.find() what is the base algorithm...Boyer-Moore?

This topic is 4704 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just wondering what the std::string.find() algorithm is base upon? Noted in another thread that Boyer-Moore is highly recommended for string finding. Can't find this info in my references or on the 'net. Anyone know? --random_thinker

Share this post


Link to post
Share on other sites
Advertisement
It is implementation-defined. The C++ standard only mandates interface and asymptotic performance, not actual algorithms and implementations. Considering that the full source code for std::string is available, you could check by yourself how your standard library implementation does it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
It is implementation-defined. The C++ standard only mandates interface and asymptotic performance, not actual algorithms and implementations. Considering that the full source code for std::string is available, you could check by yourself how your standard library implementation does it.


Why do implementations vary, because of the compiler or platform?

--random_thinker

Share this post


Link to post
Share on other sites
Some vendors may want to optimize for code space, others may choose to optimize for runtime performance. New algorithms may come along that are better than old ones, and so on.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Some vendors may want to optimize for code space, others may choose to optimize for runtime performance. New algorithms may come along that are better than old ones, and so on.


I'm trying to stick with a relatively recent version of g++ (3.3.5). Should the algorithms be more-or-less the same regardless of platform?
--random_thinker

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!