A novel algorithm to determine the leaf (leaves) of a binary tree from its preorder and postorder traversals

07/01/2020
by   Peyman Nasehpour, Ph.D., et al.
0

Binary trees are essential structures in Computer Science. The leaf (leaves) of a binary tree is one of the most significant aspects of it. In this study, we prove that the order of a leaf (leaves) of a binary tree is the same in the main tree traversals; preorder, inorder, and postorder. Then, we prove that given the preorder and postorder traversals of a binary tree, the leaf (leaves) of a binary tree can be determined. We present the algorithm BT-leaf, a novel one, to detect the leaf (leaves) of a binary tree from its preorder and postorder traversals in quadratic time and linear space.

READ FULL TEXT

page 1

page 2

page 3

page 4

page 6

page 8

page 9

page 10

research
07/01/2020

An improved algorithm to reconstruct a binary tree from its inorder and postorder traversals

In this paper, we present InPos, an improved algorithm, to reconstruct ...
research
08/29/2019

Compacted binary trees admit a stretched exponential

A compacted binary tree is a directed acyclic graph encoding a binary tr...
research
07/01/2022

Embedding phylogenetic trees in networks of low treewidth

Given a rooted, binary phylogenetic network and a rooted, binary phyloge...
research
04/27/2018

Average Case Analysis of Leaf-Centric Binary Tree Sources

We study the average size of the minimal directed acyclic graph (DAG) wi...
research
08/31/2018

How to Fit a Tree in a Box

We study compact straight-line embeddings of trees. We show that perfect...
research
02/07/2019

A fast algorithm for constructing balanced binary search trees

We suggest a new non-recursive algorithm for constructing a binary searc...
research
10/09/2020

A Tale of Two Trees: New Analysis for AVL Tree and Binary Heap

In this paper, we provide new insights and analysis for the two elementa...

Please sign up or login with your details

Forgot password? Click here to reset