检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
机构地区:[1]江西师范大学计算机信息工程学院,江西南昌330022
出 处:《江西师范大学学报(自然科学版)》2010年第2期123-127,共5页Journal of Jiangxi Normal University(Natural Science Edition)
基 金:国家"973"前期预研项目(2003CCA02800);国家自然科学基金(60273092);江西省自然基金(2008GQS0056);江西省教育厅科技项目(GJJ09142)资助
摘 要:提出树遍历统一的新解法,使其非递归算法像递归算法一样简单.首先以后序遍历为例,基于结点状态标记和遍历规则提取,从遍历定义导出遍历的递推公式,由此机械获得非递归算法和循环不变式,并用形式化方法证明其正确性.之后按不同遍历定义变换公式参数,获得二叉树前序、中序和K叉树前序、后序的递推公式,所得算法比传统算法更简洁直观,表明本解法的有效性和通用性.A united solution of tree traversal is presented.It makes its non-recursive algorithms are same easy as its recursive algorithms.From the definition of postorder,by marking node states and extracting rules,the recurrence formula of postorder is derived.Then,non-recursive algorithm and its loop invariant are obtained mechanically according to the formula,their correctness are proved formally.Furthermore,some recurrence formulas of other kinds of traversals,including preorder/inorder of binary tree,and preorder/postorder of K-ary tree,are obtained by changing formula's parameters according to their traversal definitions,and the algorithms are more simple than the traditional.Results show that our solution is valid and united.
分 类 号:TP311.1[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.147.44.106