2012-06-13 90 views
0

什么项目在根目录后面的插入 插入一个空的splay树后:1,11,3,10,8,4,6,5,7 ,9,2?splay树:什么项目在根目录

+0

2将是你的根 – DonCallisto

+0

最后一项将是根,这是张大树的主要属性。请参阅http://lowcoupling.com/post/81057347460/binary-search-avl-and-splay-trees – lowcoupling

回答

0

根据伸展树的定义:

Splaying the tree for a certain element rearranges the tree so that the element is placed at the root of the tree. 

所以我相信这将永远是插入的最后一个元素。

1
This is How the Splay tree looks after inserting each element. 
Each frame shows the splay tree after ith element is inserted. 

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

I wish,it clears your doubt!!!! 
+0

对于Splay树形图。 – 2012-07-11 19:32:41