Descendants and ascendants in binary trees

There are three classical algorithms to visit all the nodes of a binary tree-preorder, inorder and postorder traversal. From this one gets a natural labelling of the n internal nodes of a binary tree by the numbers 1, 2, ..., n, indicating the sequence in which the nodes are visited. For given...

Full description

Bibliographic Details
Main Authors: Alois Panholzer, Helmut Prodinger
Format: Article
Language:English
Published: Discrete Mathematics & Theoretical Computer Science 1997-12-01
Series:Discrete Mathematics & Theoretical Computer Science
Online Access:http://www.dmtcs.org/dmtcs-ojs/index.php/dmtcs/article/view/78
_version_ 1818751956626178048
author Alois Panholzer
Helmut Prodinger
author_facet Alois Panholzer
Helmut Prodinger
author_sort Alois Panholzer
collection DOAJ
description There are three classical algorithms to visit all the nodes of a binary tree-preorder, inorder and postorder traversal. From this one gets a natural labelling of the n internal nodes of a binary tree by the numbers 1, 2, ..., n, indicating the sequence in which the nodes are visited. For given n (size of the tree) and j (a number between 1 and n), we consider the statistics number of ascendants of node j and number of descendants of node j. By appropriate trivariate generating functions, we are able to find explicit formulae for the expectation and the variance in all instances. The heavy computations that are necessary are facilitated by MAPLE and Zeilberger's algorithm. A similar problem comes fromlabelling the leaves from left to right by 1, 2, ..., n and considering the statistic number of ascendants (=height) of leaf j. For this, Kirschenhofer [1] has computed the average. With our approach, we are also able to get the variance. In the last section, a table with asymptotic equivalents is provided for the reader's convenience.
first_indexed 2024-12-18T04:43:48Z
format Article
id doaj.art-9d590c6efd7a46ffad378cad98da38ff
institution Directory Open Access Journal
issn 1462-7264
1365-8050
language English
last_indexed 2024-12-18T04:43:48Z
publishDate 1997-12-01
publisher Discrete Mathematics & Theoretical Computer Science
record_format Article
series Discrete Mathematics & Theoretical Computer Science
spelling doaj.art-9d590c6efd7a46ffad378cad98da38ff2022-12-21T21:20:38ZengDiscrete Mathematics & Theoretical Computer ScienceDiscrete Mathematics & Theoretical Computer Science1462-72641365-80501997-12-0111Descendants and ascendants in binary treesAlois PanholzerHelmut ProdingerThere are three classical algorithms to visit all the nodes of a binary tree-preorder, inorder and postorder traversal. From this one gets a natural labelling of the n internal nodes of a binary tree by the numbers 1, 2, ..., n, indicating the sequence in which the nodes are visited. For given n (size of the tree) and j (a number between 1 and n), we consider the statistics number of ascendants of node j and number of descendants of node j. By appropriate trivariate generating functions, we are able to find explicit formulae for the expectation and the variance in all instances. The heavy computations that are necessary are facilitated by MAPLE and Zeilberger's algorithm. A similar problem comes fromlabelling the leaves from left to right by 1, 2, ..., n and considering the statistic number of ascendants (=height) of leaf j. For this, Kirschenhofer [1] has computed the average. With our approach, we are also able to get the variance. In the last section, a table with asymptotic equivalents is provided for the reader's convenience.http://www.dmtcs.org/dmtcs-ojs/index.php/dmtcs/article/view/78
spellingShingle Alois Panholzer
Helmut Prodinger
Descendants and ascendants in binary trees
Discrete Mathematics & Theoretical Computer Science
title Descendants and ascendants in binary trees
title_full Descendants and ascendants in binary trees
title_fullStr Descendants and ascendants in binary trees
title_full_unstemmed Descendants and ascendants in binary trees
title_short Descendants and ascendants in binary trees
title_sort descendants and ascendants in binary trees
url http://www.dmtcs.org/dmtcs-ojs/index.php/dmtcs/article/view/78
work_keys_str_mv AT aloispanholzer descendantsandascendantsinbinarytrees
AT helmutprodinger descendantsandascendantsinbinarytrees