Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

本题若用平衡树则有以下数据(我的实现):

Posted by zzyu6ds at 2015-07-21 22:51:47 on Problem 2081 and last updated at 2016-01-04 12:29:53
莫名的splay(单旋): TLE;
CLRS上的weight-balanced-tree :938ms
SBT :579ms;
不splay,乱旋:563ms;
B+Tree([2,4]):297ms;
Red-Black T: 282ms;
B-Tree([1,3]):282ms;//2-3-4 Tree;
AVL :235ms;
B-Tree([4,9]):219ms;
B-Tree([2,5]):204ms;
B+Tree([4,8]):188ms;
B+Tree([3,6]):172ms;
B-Tree([3,7]):172ms;
注:本题数据太小,B-Tree上用二分搜索加速体现不出来优势,故用了线性查找;
但B+Tree用了二分查找;
[3,7]表示一个结点可能有3,4,5,6,7个数据;
//本题还是推荐hash

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator