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


Generalized non-recursive traversal of binary trees
Authors:A. C. Kilgour
Abstract:A non-recursive algorithm for the traversal of a binary tree is presented in which the order of traversal is defined by an external data array, allowing any of the six possible orders to be selected without modification to the algorithm itself. The extra storage requirements are three pointer variables and two bits per node (or two bits per level if an auxiliary stack is used.) The algorithm is a generalization of the pointer reversal method of Schorr and Waite and is derived by transformation of a generalized recursive version. The algorithm is described using the notation and conventions of Pascal.
Keywords:Binary tree  Tree traversal  Recursion elimination  Pascal
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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