A New Visualization Technique for Teaching and Learning Recursion
摘要
Recursion is one of the most challenging concepts for students learning data structures and algorithms. Its self-referential nature often leads to confusion, making it difficult to form a clear and accurate mental model. To address this, various visualization techniques have been developed. However, most existing visualizations focus primarily on control flow and tend to overlook the equally important data flow in recursive processes. Additionally, traditional call stack- or recursion tree-based visualizations often fail to represent the backflow of recursion. In this work, we analyze the difficulties of understanding recursion and, based on this analysis, introduce a novel interactive visualization technique. Our method employs a chained-circle visual metaphor and explicitly depicts forward flows, backward flows, and data flows, providing a more intuitive and comprehensive understanding of recursion.