arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1805.05124cs.PLcs.CY
收藏

使用结构递归的向量程序设计

Vector Programming Using Structural Recursion

Marco T. Morazán

摘要:

向量程序设计是许多计算机科学导论课程中的一个重要课题。尽管向量很重要,但学习向量编程对许多学生来说是一个挫折的来源,因为他们在解决向量索引错误时感到无所适从。尽管向量的大小是一个自然数,但还没有努力定义一个有用的递归数据定义来帮助初学者设计向量处理函数。本文定义了向量区间的概念,并描述了如何利用其递归结构来设计向量处理函数。所描述的方法提供了一个上下文,初学者可以使用它来推理正确的向量索引,而不是让他们游离于这个责任之外。正确使用所述方法的一个关键特征是,如果学生处理正确的向量区间,则不会出现向量索引错误。详细描述了这种方法的课堂部署。到目前为止,学生们已经发现向量区间有助于避免在处理区间的所有向量元素时出现越界索引错误。

英文摘要:

Vector programming is an important topic in many Introduction to Computer Science courses. Despite the importance of vectors, learning vector programming is a source for frustration to many students given that they feel left adrift when it comes to resolving vector indexing errors. Even though the size of a vector is a natural number, there have been no efforts to define a useful recursive data definition to help beginners design vector processing functions. This article defines the concept of a vector interval and describes how to exploit its recursive structure to design vector processing functions. The described methodology provides a context beginners can use to reason about proper vector indexing instead of leaving them adrift with this responsibility. A key feature of properly using the described methodology is that if students process the correct vector interval then vector indexing errors can not arise. The classroom deployment of this approach is described in detail. Students, to date, have found vector intervals helpful in avoiding out-of-bounds indexing errors when all the vector elements of the interval are processed.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑