摘要
汉诺塔问题是计算机课程中常见的一个实例,其动态演示可以加深学生对算法执行过程的理解。本文利用面向对象技术,将汉诺塔的动态演示在组件级上进行编程实现。对象的数据成员和方法的灵活设计使得汉诺塔的动态实现代码更加简单清晰,而组件方法的恰当设置使得其可以像简单控件那样在其他语言开发环境中得到更好的应用,增强了程序的灵活性和可重用性。
Hanoi Tower problem is a very common example in computer courses, and its dynamic demonstration is helpful for the students to master the algorithm implementation. By making use of the object-oriented technology, the paper programs the dynamic demonstration of Hanoi Tower at component level. The flexible design of data members and methods of the object makes the code simpler and clearer. And by component programming,the demonstration can be applied in other development environments as simple controls,which benefits the flexibility and reproducibility of the program.
出处
《科技广场》
2016年第3期40-43,共4页
Science Mosaic
基金
嵌入式实验课程错误管理系统的研究与实现(编号:JXJG-14-2-20)