摘要
二叉树深度求解是一个有多解的问题,从算法的时间复杂度和空间复杂度着眼,采用追踪栈顶指针,层次遍历的两种算法实现二叉树深度的求解,并对算法进行了分析和比较.
Getting the depth of binary tree has various solution. Based on the cosideration of view of the time complexity and space complexity for algorithms, two non-recursive algrithms for getting the depth of binary tree are obtained by tracing the top pointer of stack and level traversal.
出处
《四川大学学报(自然科学版)》
CAS
CSCD
1996年第3期259-261,共3页
Journal of Sichuan University(Natural Science Edition)
关键词
二叉树深度
非递归
遍历算法
depth of binary tree,non-recursive, traversal algorithm