码迷,mamicode.com
首页 > 其他好文 > 详细

二维若

时间:2019-08-26 23:07:52      阅读:93      评论:0      收藏:0      [点我收藏+]

标签:zigzag   rom   nod   lin   star   splay   type   插入   操作   

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?

说明:at the leaf:说明直接插入到 leaf 即可,不需要移动

at the root:说明需要调整到 root,但是一个一个调整

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

说明:如果 search 不到元素,就将那个元素 splay,按照 zigzag 或者 zigzig 规则操作

二维若

标签:zigzag   rom   nod   lin   star   splay   type   插入   操作   

原文地址:https://www.cnblogs.com/alex-bn-lee/p/11415291.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!