| 注册
首页|期刊导航|华东师范大学学报(自然科学版)|基于智能体的可交互数据结构和算法可视化实现

基于智能体的可交互数据结构和算法可视化实现

庞瑞洋 陆雪松

华东师范大学学报(自然科学版)Issue(5):32-42,11.
华东师范大学学报(自然科学版)Issue(5):32-42,11.DOI:10.3969/j.issn.1000-5641.2025.05.004

基于智能体的可交互数据结构和算法可视化实现

Interactive data structure and algorithm visualization based on AI agents

庞瑞洋 1陆雪松1

作者信息

  • 1. 华东师范大学 数据科学与工程学院,上海 200062
  • 折叠

摘要

Abstract

Data structures and algorithms(DSA),as a core course in computer science education,play a key role in cultivating programming skills and algorithmic thinking of students.Visualization can significantly enhance teaching effectiveness and deepen student understanding in DSA education.However,existing DSA visualization tools often rely on manually written visualization codes that lead to limitations such as limited coverage,high maintenance costs,and lack of interactivity;hence,the needs of dynamic demonstrations and personalized teaching are difficult to meet.With the outstanding performance of large language models(LLMs)in code generation,automated DSA visualization has become a promising possibility.Therefore,this study proposed an interactive visualization code generation method based on the reasoning and acting(ReAct)AI agent framework,aiming to address the low automation and insufficient interactivity of traditional visualization tools.By leveraging the code generation capabilities of LLMs and integrating with the data structure visualization(DSV)platform interface,the proposed method transformed Python-based DSA code into interactive,executable,and dynamically visualized code,thereby enhancing teaching clarity and learning experience.To systematically evaluate the effectiveness of the method,we constructed a dataset of 150 pairs of DSA code and corresponding DSV visualization code and compared three approaches—direct prompting,chain-of-thought prompting,and the ReAct AI agent approach—across several mainstream LLMs.The experimental results showed that the proposed ReAct AI agent-based method significantly outperformed the other approaches in terms of the compilation rate,execution rate,and usability rate,with the best performance observed in the DeepSeek-R1 model.This demonstrated notable improvements in the accuracy and interactivity of generated visualization code.This research confirms the feasibility and advantages of integrating LLMs with agent frameworks in DSA visualization teaching,offering a novel path toward building efficient,personalized,and automated tools for computer programming education.

关键词

数据结构与算法可视化/大语言模型/智能体/代码生成

Key words

data structure and algorithm visualization/large language model/AI agent/code generation

分类

信息技术与安全科学

引用本文复制引用

庞瑞洋,陆雪松..基于智能体的可交互数据结构和算法可视化实现[J].华东师范大学学报(自然科学版),2025,(5):32-42,11.

基金项目

国家重点研发计划(2023YFC3341200) (2023YFC3341200)

国家自然科学基金(62277017) (62277017)

华东师范大学学报(自然科学版)

OA北大核心

1000-5641

访问量0
|
下载量0
段落导航相关论文