An extensive study involving three test groups over a period of three different years was performed to determine differences between comprehension of recursive and iterative code constructs. This study involved computer science students enrolled in six different data structure classes using PASCAL and obtained 275 responses, which were statistically analyzed. Using a χ 2 test, one task—searching a linked list for a given value—showed a statistically significant ( p = 0.006) difference in comprehension favoring recursion. Another task—making a copy of a linked list—favored iteration, but not with statistical significance. Among responses with correct comprehension, a comparison of means test was performed on the comprehension times among the latter two groups in the study. There was a faster rate of comprehension of the recursive code for both of the tasks ( p = 0.096 for the search and p = 0.045 for the copy). A two-way analysis of variance suggested a tendency toward an interaction effect between task and construct in terms of comprehension time.
Read full abstract