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

Re:这不叫O(n)...明明是N方,只不过一般没有最坏情况而已。。

Posted by angeldust at 2012-03-06 11:29:24 on Problem 3663 and last updated at 2012-03-06 11:32:56
In Reply To:这不叫O(n)...明明是N方,只不过一般没有最坏情况而已。。 Posted by:winL at 2011-08-26 15:54:34
排序以后,第一次确定2个指针位置,后面就是2个指针慢慢往中间某个位置靠,所以复杂度就是两个指针移动的距离刚好是n,均摊o(n)比二分快哦,亲

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