Title :
A new non-recursive algorithm for binary search tree traversal
Author :
Al-Rawi, Ali ; Lansari, Azzedine ; Bouslama, Faouzi
Author_Institution :
Coll. of Inf. Syst., Zayed Univ., Abu Dhabi, United Arab Emirates
Abstract :
Binary tree traversal refers to the process of visiting each node in a specified order. There are two ways to visit a tree: recursively and non-recursively. Most references introduce tree traversal using recursion only. Our literature survey indicated that most references only show the implementations of the recursive algorithms, and only few references address the issue of nonrecursive algorithms. In this paper, we investigate and compare recursive and non-recursive algorithms for in-order, preorder, and post-order traversals. The in-order traversal of a binary search tree is important in searching algorithms, operating systems, and compiler design. In this paper we propose a new non-recursive algorithm for in-order binary search trees that is both efficient and easy to understand. The implementation of this new algorithm was done in Java and the complete algorithm was tested. The new algorithm was found to be faster than other nonrecursive algorithms.
Keywords :
Java; program compilers; tree data structures; tree searching; Java implementation; binary search tree traversal; compiler design; in-order traversals; nonrecursive algorithm; nonrecursive tree traversal; operating systems; post-order traversals; preorder traversals; recursion; recursive algorithms; recursive tree traversal; searching algorithms; specified tree node order; Algorithm design and analysis; Binary search trees; Binary trees; Computer science; Educational institutions; Information systems; Java; Operating systems; Process design; Testing;
Conference_Titel :
Electronics, Circuits and Systems, 2003. ICECS 2003. Proceedings of the 2003 10th IEEE International Conference on
Print_ISBN :
0-7803-8163-7
DOI :
10.1109/ICECS.2003.1301900