摘要
本文提出用森林进行递归算法分析的方法,该方法将递归逻辑映射到森林,具体处理上以树为处理单元,对程序递归结构分析,定义树节点,通过搜索建立树和调用状态表,所建立的树不局限于二叉树,根据实际问题可以是单分支树、二叉树、多叉树,甚至多棵树组成的森林,到达叶子节点进行回溯,根据程序执行情况,多棵树需要树间跳转;依据树和调用状态表的对照,既分析全面,又使分析结构清晰、结果准确、适用广泛,有效解决了递归算法结果分析中的难题。
This paper presents a method of recursive algorithm analysis by forest.This method maps recur-sive logic to forest.Tree is used as processing unit.The recursive structure of program is analyzed and tree nodes are defined.Tree is established by searching and calling state table.The tree is not limited to binary tree.According to practical problems,it can be composed of single branch tree,binary tree,multi-branch tree or even multi-tree.According to the implementation of the program,many trees need to jump between trees.According to the comparison between the tree and the invocation state table,the analysis is comprehensive,and the analysis structure is clear,the results are accurate,and the application is extensive,which effectively solves the difficulties in the analysis of the results of the recursive algorithm.
出处
《计算机科学与应用》
2019年第7期1398-1405,共8页
Computer Science and Application