2012-06-13 123 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