An Analysis of Iterative and Recursive Problem Performance

Iteration and recursion are fundamental programming constructs in introductory computer science. Understanding the relationship between contextual factors, such as problem formulation or student background, that relate to performance on iteration and recursion problems can help inform pedagogy. We present the results of a study of 162 undergraduate participants tasked with comprehending iterative, recursive, and tail-recursive versions of CS1 functions. First, we carry out a task-specific analysis, finding that students perform significantly better on the iterative framings of two problems with non-branching numerical computation and significantly better on the recursive framing of another that involves array classification. Second, we investigate differences in the most common student mistakes by program framing. We find that students were more likely to produce wrong answers with incorrect types or structures for recursive and tail-recursive program versions. Finally, we investigated correlations between programming performance and background factors including experience, gender, ethnicity, affluence, and spatial ability. We find that the factors relevant to explaining performance are similar for both iterative and recursive problems. While programming experience is the most significant factor, we find that spatial ability, gender, and ethnicity were more relevant for explaining performance than affluence.

An Analysis of Iterative and Recursive Problem Performance

  • Author Endres, Madeline; Weimer, Westley; Kamil, Amir
  • Publication Title Proceedings Of The 52Nd ACM Technical Symposium On Computer Science Education
  • Publication Year 2021
  • BPC Focus Gender
  • Methodology Survey
  • Analytic Method T-test, ANOVA, Correlation
  • Institution Type NA
  • DOI 10.1145/3408877.3432391
  • URL https://doi.org/10.1145/3408877.3432391