Leftist Tree - Merging Height Biased Leftist Trees

Merging Height Biased Leftist Trees

Merging two nodes together depends on whether the tree is a min or max height biased leftist tree. For a min height biased leftist tree, set the higher valued node as its right child of the lower valued node. If the lower valued node already has a right child, then merge the higher valued node with the sub-tree rooted by the right child of the lower valued node.

After merging, the s-value of the lower valued node must be updated (see above section, s-value). Now check if the lower valued node has a left child. If it does not, then move the right child to the left. If it does have a left child, then the child with the highest s-value should go on the left.

Read more about this topic:  Leftist Tree

Famous quotes containing the words merging, height, biased and/or trees:

    Adultery is the vice of equivocation.
    It is not marriage but a mockery of it, a merging that mixes love and dread together like jackstraws. There is no understanding of contentment in adultery.... You belong to each other in what together you’ve made of a third identity that almost immediately cancels your own. There is a law in art that proves it. Two colors are proven complimentary only when forming that most desolate of all colors—neutral gray.
    Alexander Theroux (b. 1940)

    Much more frequent in Hollywood than the emergence of Cinderella is her sudden vanishing. At our party, even in those glowing days, the clock was always striking twelve for someone at the height of greatness; and there was never a prince to fetch her back to the happy scene.
    Ben Hecht (1893–1964)

    Scientists are human—they’re as biased as any other group. But they do have one great advantage in that science is a self-correcting process.
    Cyril Ponnamperuma (b. 1923)

    A long war like this makes you realise the society you really prefer, the home, goats chickens and dogs and casual acquaintances. I find myself not caring at all for gardens flowers or vegetables cats cows and rabbits, one gets tired of trees vines and hills, but houses, goats chickens dogs and casual acquaintances never pall.
    Gertrude Stein (1874–1946)