An Inquistive Result on DFS Problem of Binary Trees (original) (raw)
Related papers
On the Optimality of a Family of Binary Trees
2011
In this paper we present an analysis of the complexity of a class of algorithms. These algorithms recursively explore a binary tree and need to make two recursive calls for one of the subtrees and only one for the other. We derive the complexity of these algorithms in the worst and in the best case and show the tree structures for which these cases happen.
ARTICLE INFO 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.
Dynamic DFS Tree in Undirected Graphs: breaking the $ O (m) $ barrier
Depth first search (DFS) tree is a fundamental data structure for solving various problems in graphs. It is well known that it takes O(m + n) time to build a DFS tree for a given undirected graph G = (V, E) on n vertices and m edges. We address the problem of maintaining a DFS tree when the graph is undergoing updates (insertion and deletion of vertices or edges). We present the following results for this problem. 1. Fault tolerant DFS tree: There exists a data structure of sizeÕ(m) 1 such that given any set F of failed vertices or edges, a DFS tree of the graph G \ F can be reported inÕ(n|F|) time. 2. Fully dynamic DFS tree: There exists a fully dynamic algorithm for maintaining a DFS tree that takes worst caseÕ(√ mn) time per update for any arbitrary online sequence of updates. 3. Incremental DFS tree: There exists an incremental algorithm for maintaining a DFS tree that takes worst caseÕ(n) time per update for any arbitrary online sequence of edge insertion. These are the first o(m) worst case time results for maintaining a DFS tree in a dynamic environment. Moreover, our fully dynamic algorithm provides, in a seamless manner, the first deterministic algorithm with O(1) query time and o(m) worst case update time for connectivity, biconnectivity, and 2-edge connectivity in the dynamic subgraph model.
Journal of Algorithms and Computation, 2017
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. http://jac.ut.ac.ir/article\_406\_49.html
Binary search trees of almost optimal height
Acta Informatica, 1990
First we present a generalization of symmetric binary B-trees, SBB(k)-[(1) 1 trees. The obtained structure has a height of only 1+~ log(n+l) ~, where k may be chosen to be any positive integer. The maintenance algorithms require only a constant number of rotations per updating operation in the worst case.
The Maximum Binary Tree Problem
Algorithmica, 2021
We introduce and investigate the approximability of the maximum binary tree problem (MBT) in directed and undirected graphs. The goal in MBT is to find a maximum-sized binary tree in a given graph. MBT is a natural variant of the well-studied longest path problem, since both can be viewed as finding a maximum-sized tree of bounded degree in a given graph. The connection to longest path motivates the study of MBT in directed acyclic graphs (DAGs), since the longest path problem is solvable efficiently in DAGs. In contrast, we show that MBT in DAGs is in fact hard: it has no efficient exp(−O(log n/ log log n))-approximation algorithm under the exponential time hypothesis, where n is the number of vertices in the input graph. In undirected graphs, we show that MBT has no efficient exp(−O(log 0.63 n))approximation under the exponential time hypothesis. Our inapproximability results rely on self-improving reductions and structural properties of binary trees. We also show constant-factor inapproximability assuming P = NP. In addition to inapproximability results, we present algorithmic results along two different flavors: (1) We design a randomized algorithm to verify if a given directed graph on n vertices contains a binary tree of size k in 2 k poly(n) time. (2) Motivated by the longest heapable subsequence problem, introduced by Byers, Heeringa, Mitzenmacher, and Zervas, ANALCO 2011, which is equivalent to MBT in permutation DAGs, we design efficient algorithms for MBT in bipartite permutation graphs.
Towards a More Precise Analysis of an Algorithm to Generate Binary Trees: A Tutorial
The Computer Journal, 1998
For the analysis of an algorithm to generate binary trees, the behaviour of a certain sequence of numbers is essential. In the original paper, it was expressed by a recursion. Here, we show how to solve this (and similar) recursions, both explicitly and asymptotically. Some additional information about useful mathematical software is also provided.