3

Let $T$ be a finitely branching tree. I will call a subtree of $T$ a "tassel" if it is of width one, closed downward, and is maximal subject to this criterion. Equivalently, a tassel is a sequence of nodes $A_1,\dots, A_n$ such that $A_i$ is the parent of $A_{i+1}$, $A_n$ has no child, and $A_1$ either has no parent or its parent has at least two children.

A left tassel is a tassel such that $A_1$ has no parent or $A_1$ is the leftmost child of its parent.

Suppose that I repeatedly delete all left tassels from the tree, so that $T_0=T$ and $T_{n+1}$ is $T_n$ but with all left tassels removed. This will terminate with the empty tree, in worst-case time $O(N)$, where $N$ is the number of nodes in $T$. (Consider the case where every interior node in $T$ has exactly one right descendant.)

Similarly, suppose that I repeatedly delete all leaves from the tree, so that $T_0=T$ and $T_{n+1}=T_n$ with all leaves removed. This will terminate with the empty tree, in worst-case time $O(N)$ (if $T$ is of width 1.)

My question is whether I can get an empty tree in better than worst-case time $O(N)$ by alternating these approaches. So, $T_{2n+1}$ is obtained from $T_{2n}$ by deleting all left tassels, and $T_{2n+2}$ is obtained from $T_{2n+1}$ by deleting all leaves. What is the big $O$ of this algorithm? Is it better than $O(N)$?

If $T$ is a "comb" shape with teeth pointing to the right, where each tooth/time of the cone is a tassel with $k$ vertices, and the tree has $k$ teeth, the algorithm will finish in $O(k)$. This implies that the worst case is at least $O(\sqrt{N})$. Is it higher? Or is this tight?

0 Answers0