Optimal Integer Alphabetic Trees in Linear Time
نویسندگان
چکیده
We show that optimal alphabetic binary trees can be constructed in O(n) time if the elements of the initial sequence are drawn from a domain that can be sorted in linear time. We describe a hybrid algorithm that combines the bottom-up approach of the original Hu-Tucker algorithm with the top-down approach of Larmore and Przytycka’s Cartesian tree algorithms. The hybrid algorithm demonstrates the computational equivalence of sorting and level tree construction.
منابع مشابه
Optimum Alphabetic Binary Trees
We describe a modiication of the Hu{Tucker algorithm for constructing an optimal alphabetic tree that runs in O(n) time for several classes of inputs. These classes can be described in simple terms and can be detected in linear time. We also give simple conditions and a linear algorithm for determining, in some cases, if two adjacent nodes will be combined in the optimal alphabetic tree.
متن کاملBalancing weighted strings and trees in linear time
In the present paper, we address the problem of building a binary tree which leaves carry weights in a given order and which is in some sense balanced. Such a tree is denoted as a balanced alphabetic weighted tree. If the leaves of the tree are labeled with letters, their concatenation (from left to right) gives a weighted string. The tree is balanced if it minimizes the maximum of all root-to-...
متن کاملOptimal Alphabetic Trees
An algorithm of Knuth for finding an optimal binary tree is extended in several directions to solve related problems. The first case considered is restricting the depth of the tree by some predetermined integer K, and a Kn algorithm is given. Next, for trees of degree tr, rather than binary trees, Kn log tr and n log tr algorithms are found for the restricted and nonrestricted cases, respective...
متن کاملAlphabetic Trees Theory and Applications in Layout Driven Logic Synthesis Revision of TCAD Manuscript
Routing plays an important role in determining the total circuit area and circuit performance and hence must be addressed as early as possible during the design process In this paper an e ective routing driven approach for technology dependent logic synthesis which relies on alphabetic tree construction is presented Alphabetic trees are trees which are generated under the restriction that the i...
متن کاملAlphabetic Minimax Trees in Linear Time
We develop a linear time algorithm algorithm for the following problem: given an ordered sequence of n real weights w1, w2, . . . , wn, construct a binary tree on n leaves labeled with those weights when read from left to right so that the maximum value of wi plus depth of the i-th leftmost leaf is minimized. This improves the previously known O(n logn) time solutions [2,11,13]. We also give a ...
متن کامل