设为首页 加入收藏

TOP

3.6 C++(4)
2013-10-07 14:27:20 来源: 作者: 【 】 浏览:60
Tags:3.6

Generation is similar to the previous versions:

图3.6  C++(www.cppentry.com)(5)   

将这两个函数的调用包装成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.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇3.3.2 规划流程 下一篇3.6 C++(3)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: