→ asjh612: 每個insert分別是O(lg1+lg2+..+lgn)=O(nlgn) 除n為averag 02/03 22:03
→ asjh612: e 所以是O(lgn) 不過這只是我的想法XDD 02/03 22:04
→ asjh612: 不保證一定對XDD 02/03 22:06
→ harryron9: 覺得我的寫法可能拿不到分 看看就好 02/03 22:19
→ harryron9: given a set {1,2....n} nodes 02/03 22:21
→ harryron9: each node may be a leaf in same posibility 02/03 22:21
→ harryron9: thus we know that in BST average serch time is 02/03 22:23
→ harryron9: O(lgn), for those leafs serch times = tree height 02/03 22:24
→ harryron9: then the BST will be average height O(lgn) 02/03 22:25