Balanced ternary tree

Sengan.Baring-Gould@nsc.com Sengan.Baring-Gould@nsc.com
Tue, 10 Sep 2002 15:39:26 -0400


I was wondering if anyone has implemented a Balanced Ternary Tree
module for haskell. According to

http://www.ddj.com/documents/s=921/ddj9804a/9804a.htm

this would be a better datastructure for symbol tables than the
binary tree I am currently using:
* Each string is a key, which makes for O(n/2 * log m) comparisons
  where n is the average string length and m is the number of string
  in the table,
* A balanced ternary tree would be O(n + log m).

(DDJ's code does not balance the tree)

Sengan