5 research outputs found

    Three algorithms on Braun trees

    No full text

    Functional Pearls - Three Algorithms on Braun Trees

    No full text
    Introduction Among the many flavors of balanced binary trees, Braun trees (Braun & Rem, 1983) are perhaps the most circumscribed. For any given node of a Braun tree, the left subtree is either exactly the same size as the right subtree, or one element larger. Braun trees always have minimum height, and the shape of each Braun tree is completely determined by its size. In return for this rigor, algorithms that manipulate Braun trees are often exceptionally simple and elegant, and need not maintain any explicit balance information. Braun trees have been used to implement both flexible arrays (Braun & Rem, 1983; Hoogerwoord, 1992; Paulson, 1996) and priority queues (Paulson, 1996; Bird, 1996). Most operations involving a single element (e.g. adding, removing, inspecting or updating an element) take O(logn) time since the trees are balanced. We consider three algorithmically interesting operations that manipulate entire trees. First, we give an<F24
    corecore