Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

PREPRINT. Computer Journal, 33(5):471472, 1990. A Note on the Expected Behaviour of Binary

Summary: PREPRINT. Computer Journal, 33(5):471­472, 1990.
A Note on the Expected Behaviour of Binary
Tree Traversals
Arne Andersson
Department of Computer Science
Lund University
Lund, Sweden
Brinck and Foo [1, 2] have analyzed tree traversal algorithms using
threads and stack. In this note we show that, contrary to the results
in the two referred papers, a preorder traversal is performed faster with
a stack than with threads, in terms of pointer assignments. Moreover,
the preorder­stack traversal is faster than any of the other standard
traversals analyzed in [1] and [2].
1 Introduction
It is well known that adding threads to a binary tree makes it possible to
traverse the tree in preorder, inorder or postorder without using any stack.
Although the asymptotic complexity are the same for the stack and thread
algorithms the time constant may differ. A comparison of the two methods
has been made by Brinck and Foo [1, 2]. They present efficient algorithms for


Source: Andersson, Arne - Department of Information Technology, Uppsala Universitet


Collections: Computer Technologies and Information Sciences