Generation is similar to the previous versions:
将这两个函数的调用包装成Prefix的一个成员函数,效果更佳。
Overall, this version seems especially clear and elegant—the code is com- pact, the data structure is visible and the algorithm is completely transparent. Sadly, there is a price to pay: this version runs much slower than the original C version, though it is not the slowest. We’ll come back to performance measure- ments shortly.
Exercise 3-5. The great strength of the STL is the ease with which one can ex- periment with different data structures. Modify the C++(www.cppentry.com) version of Markov to usevarious structures to represent the prefix, suffix list, and state table. How does performance change for the different structures
Exercise 3-6. Write a C++(www.cppentry.com) version that uses only classes and the string data type but no other advanced library facilities. Compare it in style and speed to the STL versions.