[理工] 台大電機丙 103 資結 第四題(d)
Consider an AVL tree with n nodes,
(c) Now we add a field lsize to each node in the tree,
which records the number of nodes in its left subtree plus 1.
What is the time complexity to update such information during one insertion?
小弟有查到這是HorowitzC++聖經第二版 p. 578 7. 的習題
知道time complexity 是 O(log n) 但是不知道如何實作?
不知道有沒有大神願意分享自己的code
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.230.245.19
※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1483627972.A.43D.html
推
01/06 13:35, , 1F
01/06 13:35, 1F
→
01/06 13:35, , 2F
01/06 13:35, 2F
推
01/07 12:50, , 3F
01/07 12:50, 3F
→
01/07 12:50, , 4F
01/07 12:50, 4F