基于生成递归的向量程序设计
Vector Programming Using Generative Recursion
摘要:
向量程序设计是许多计算机科学导论课程中的一个重要课题。尽管向量很重要,但学习向量编程对许多学生来说是一个挫折。大部分的挫折都源于发现了表现为越界索引的bug的来源。问题是,这些错误有时根源于错误地计算索引。然而,在其他时候,这些错误的根源是关于如何正确处理向量的错误推理。不幸的是,无论哪种方式,初学者往往被遗弃,以解决自己的索引错误。本文将使用向量区间和结构递归进行向量编程的工作扩展到使用生成递归。至于使用结构递归解决的问题,向量区间为初学者提供了一个有用的框架,用于设计正确索引向量的代码。本文介绍了一些方法和具体示例,其他人可以使用这些方法和示例来构建自己的CS1模块,这些模块涉及使用任何程序设计语言进行向量编程。
英文摘要:
Vector programming is an important topic in many Introduction to Computer Science courses. Despite the importance of vectors, learning vector programming is a source of frustration for many students. Much of the frustration is rooted in discovering the source of bugs that are manifested as out-of-bounds indexing. The problem is that such bugs are, sometimes, rooted in incorrectly computing an index. Other times, however, these errors are rooted in mistaken reasoning about how to correctly process a vector. Unfortunately, either way, all too often beginners are left adrift to resolve indexing errors on their own. This article extends the work done on vector programming using vector intervals and structural recursion to using generative recursion. As for problems solved using structural recursion, vector intervals provide beginners with a useful framework for designing code that properly indexes vectors. This article presents the methodology and concrete examples that others may use to build their own CS1 modules involving vector programming using any programming language.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。