duedl0r
Reputation
487
Top tag
Next privilege 500 Rep.
Access review queues
 Aug 15 awarded Enlightened Dec 4 awarded Informed Jun 20 awarded Yearling Feb 21 awarded Caucus Jun 20 awarded Yearling Nov 1 awarded Good Answer Oct 31 comment Get 100 highest numbers from an infinite list @SachinShanbhag: Yes, searching in a set of constant count of elements is always O(1). Oct 27 awarded Supporter Oct 27 comment Get 100 highest numbers from an infinite list @Nosocks: Yes, x is just a number, like O(1) or O(100). It has to be a constant number, not a variable like `n` which grows if the problem gets bigger. Oct 26 awarded Critic Oct 26 awarded Nice Answer Oct 26 awarded Editor Oct 26 comment Get 100 highest numbers from an infinite list @StevenJeuris: Ok, thanks for pointing that out. Oct 26 revised Get 100 highest numbers from an infinite list added 127 characters in body Oct 26 comment Get 100 highest numbers from an infinite list @StevenJeuris: Yes, for an unsorted list it's O(100). For a sorted list you can expect O(50), right? Oct 26 awarded Teacher Oct 26 comment Get 100 highest numbers from an infinite list @hamstergene: what function are you talking about? the value 100 seems pretty constant to me.. Oct 26 comment Get 100 highest numbers from an infinite list @hamstergene: In that case you got the basics wrong. In your wikipedia link there is a property ("Multiplication by a constant"): `O(k*g) = O(g) if k not zero and constant`. => `O(50*1) = O(1)`. Oct 26 comment Get 100 highest numbers from an infinite list @hamstergene: I don't share your opinion. Do you have a source which proves your claim? Oct 26 answered Get 100 highest numbers from an infinite list