If the two-dimensional

BSTrootleafinsert.txt

Consider an initially empty BST and the sequence of values 1 2 3 4 5 6.

  1. Show the tree resulting from inserting these values "at the leaf". What is its height?
  2. Show the tree resulting from inserting these values "at the root". What is its height?
  3. Show the tree resulting from an alternate at-root-insertion and at-leaf-insertion, starting with at-the-leaf. What is its height?

Description: at the leaf: Description leaf can be directly inserted into, need not be moved

at the root: the need to adjust to the root, but one by one to adjust

Splaying.txt

  1. Given an initially empty splay tree:
    • show the changes in the splay tree after each splay-insertion of the node values 5 3 8 7 4

  2. Given an initially empty splay tree:
    1. show the changes in the splay tree after each splay-insertion of the node values b c d e f g ...

    2. and then the splay tree after a search for node a ...

    3. and then the splay tree after a search for node d

Note: If you can not search element, that element will splay, in accordance with the rules of operation zigzag or zigzig

Guess you like

Origin www.cnblogs.com/alex-bn-lee/p/11415291.html