# Alphabetic Minimax Trees in Linear Time

• Paweł Gawrychowski
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7913)

## Abstract

We develop a linear time algorithm for the following problem: given an ordered sequence of n real weights, construct a binary tree on n leaves labelled with those weights when read from left to right minimizing the maximum value of w i plus the depth of the corresponding leaf. This improves the previously known O(nlogn) time solutions [3,10,12]. Assuming that the integer and the fractional part of each weight is given separately, our solution works in the linear decision tree model, i.e., we use only the basic arithmetical operations on the input numbers. To decide (efficiently) which operations to perform we need the word RAM model, though. We provide a simplified $$\mathcal{O}(nd)$$ version of the algorithm, where d is the number of distinct integer parts, which does not require the full power of the word RAM model in order to decide which operations to perform. Nevertheless, it improves the previously known $$\mathcal{O}(nd\log\log n)$$ solution of Gagie [5].

## Keywords

minimax tree Yeung’s inequality linear decision tree

## References

1. 1.
Bartoschek, C., Held, S., Maßberg, J., Rautenbach, D., Vygen, J.: The repeater tree construction problem. Inf. Process. Lett. 110(24), 1079–1083 (2010)
2. 2.
Blum, M., Floyd, R., Pratt, V., Rivest, R., Tarjan, R.: Time bounds for selection. Journal of Computer and System Sciences 7(4), 448–461 (1973)
3. 3.
Coppersmith, D., Klawe, M., Pippenger, N.: Alphabetic Minimax Trees of Degree at Most t. SIAM Journal on Computing 15, 189 (1986)
4. 4.
Parker Jr., D.S.: Combinatorial Merging and Huffman’s Algorithm. IEEE Transactions on Computers, 365–367 (1979)Google Scholar
5. 5.
Gagie, T.: A new algorithm for building alphabetic minimax trees. Fundam. Inf. 97, 321–329 (2009), http://portal.acm.org/citation.cfm?id=1735991.1735995
6. 6.
Gawrychowski, P., Gagie, T.: Minimax trees in linear time with applications. In: Fiala, J., Kratochvíl, J., Miller, M. (eds.) IWOCA 2009. LNCS, vol. 5874, pp. 278–288. Springer, Heidelberg (2009)
7. 7.
Golumbic, M.C.: Combinatorial merging. IEEE Trans. Comput. 25, 1164–1167 (1976), http://dx.doi.org/10.1109/TC.1976.1674574
8. 8.
Hoover, H.J., Klawe, M.M., Pippenger, N.J.: Bounding fan-out in logical networks. J. ACM 31, 13–18 (1984), http://doi.acm.org/10.1145/2422.322412
9. 9.
Hu, T., Kleitman, D., Tamaki, J.: Binary trees optimum under various criteria. SIAM Journal on Applied Mathematics 37(2), 246–256 (1979)
10. 10.
Hu, T., Tucker, A.: Optimal computer search trees and variable-length alphabetical codes. SIAM Journal on Applied Mathematics 21(4), 514–532 (1971)
11. 11.
Huffman, D.: A method for the construction of minimum-redundancy codes. Proceedings of the IRE 40(9), 1098–1101 (1952)
12. 12.
Kirkpatrick, D., Klawe, M.: Alphabetic minimax trees. SIAM Journal on Computing 14, 514 (1985)
13. 13.
Larmore, L.L., Przytycka, T.M.: The optimal alphabetic tree problem revisited. J. Algorithms 28(1), 1–20 (1998)
14. 14.
van Leeuwen, J.: On the construction of Huffman trees? In: ICALP, pp. 382–410 (1976)Google Scholar
15. 15.
Yeung, R.: Alphabetic codes revisited. IEEE Transactions on Information Theory 37(3), 564–572 (2002)