当前在线人数16669
首页 - 分类讨论区 - 电脑网络 - 葵花宝典版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Re: an algorithm question
[同主题阅读] [版面: 葵花宝典] [作者:coconut] , 2004年08月19日16:41:23
coconut
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: coconut (coconut), 信区: Programming
标  题: Re: an algorithm question
发信站: Unknown Space - 未名空间 (Thu Aug 19 16:52:56 2004), 站内信件


The algorithm I mentioned is O (size) no matter what N is.  Grab a
book.

Also, the N variable can be discarded.  Either it is so small
comparing to size, it is effectively a constant.  Or it is on
the order of size, say size/2.  Let me also remind you that
algorithms such as finding the median etc are O (size).

A property of divide-n-conquer algorithm is that if you can
at each iteration, reduce the total size of the problem to
a proportionally smaller problem, the entire solution is
guarranteed linear.

【 在 perlgolf (perlgolf) 的大作中提到: 】
: 【 在 coconut (coconut) 的大作中提到: 】
: : 1. get N largest numbers from the array O (size).
: :    look it up in any algorithm book.
: : 2. sum.
: you sure?  what if N is not constant?  should it be N*size?


--
Imagine the most witty and concise verbal gem ever uttered.
Now imagine I said it, and quoted it here.

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 4.29.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996