[理工] 資結 R-B tree/AVL tree rotation次數
小弟有2個問題想請教各位
http://i.imgur.com/gSORaVw.jpg


1. 圖一的E選項跟圖二的D選項
這兩個選項都沒有在答案裡頭,難道insert一個new Node的rotation次數有可能會超過兩次嗎??
2.請問R-B tree跟AVL tree的rotation次數算法是一樣的嗎?
都是RL,LR記做兩次Rotation,而LL與RR只記一次Rotation?
(記得洪逸只有在AVL tree說過LR與RL要多記一次旋轉,R-B tree就沒特別說,所以不知道是否一樣)
-----
Sent from JPTT on my Samsung SM-G950F.
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.217.235.124
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1542458041.A.1AE.html
推
11/17 21:03,
7年前
, 1F
11/17 21:03, 1F
推
11/17 21:07,
7年前
, 2F
11/17 21:07, 2F
→
11/17 21:07,
7年前
, 3F
11/17 21:07, 3F
→
11/17 21:08,
7年前
, 4F
11/17 21:08, 4F

→
11/17 21:24,
7年前
, 5F
11/17 21:24, 5F
推
11/17 21:59,
7年前
, 6F
11/17 21:59, 6F
→
11/17 22:36,
7年前
, 7F
11/17 22:36, 7F
→
11/17 22:36,
7年前
, 8F
11/17 22:36, 8F
推
11/17 22:39,
7年前
, 9F
11/17 22:39, 9F
→
11/17 22:39,
7年前
, 10F
11/17 22:39, 10F
→
11/17 23:31,
7年前
, 11F
11/17 23:31, 11F

推
11/18 02:16,
7年前
, 12F
11/18 02:16, 12F