首页 | 本学科首页   官方微博 | 高级检索  
     检索      

关于二叉树的层次遍历算法
引用本文:王军.关于二叉树的层次遍历算法[J].铜仁学院学报,2004,6(4):39-41.
作者姓名:王军
作者单位:铜仁师范高等专科学校,数学系,贵州,铜仁,554300
摘    要:二叉树的遍历就是对二叉树中的每一个结点访问一次,且仅访问一次。本介绍二叉树的层次遍历算法是利用队列的队头、队尾指针及树节点的左、右指针;从根节点开始,队头指针对应的左、右指针中不空依次入队,队尾指针加1;其后,队头指针加1,并删除原队头指针:取出当前的队头指针,重复前面的步骤,直至队空为止。

关 键 词:二叉树  链式存储  队列  访问  层次遍历算法
文章编号:1671-9972(2004)04-0039-(03)
修稿时间:2004年3月6日

On Algorithm of the Floor Traversing of the Binary Tree
Wang Jun.On Algorithm of the Floor Traversing of the Binary Tree[J].Journal of Tongren University,2004,6(4):39-41.
Authors:Wang Jun
Abstract:The floor traversing of the binary tree means visiting the binary tree according to the floors. The visiting process means that making use of the queue stores the pointer of the node by the way of the floors. After the left-right pointer of every node is stored. The node of the queue-head pointer is visited. Then, the left-right pointer of the recent queue-head is stored after canceling the pointer of the queue-head. The floor traversing of the binary tree is completed throng repeatedly executing the procedure in the way. In the end the floor traversing algorithm of the binary is gotten.
Keywords:
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号