lkml.org 
[lkml]   [2015]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL] kdbus for 4.1-rc1
On Thu, Apr 23, 2015 at 11:33:19PM +0200, Richard Weinberger wrote:
> > No it's not. O(256) equals O(1).
>
> Yeah, that's absolutely correct.
> I think Boris wanted to say that iterating over all hash buckets
> can be costly.

You are thinking of 'k' (the constant), where you usually have k*O(1), where k
does matter when comparing two algorithms with the same Big O value. And
sometimes even different O() values if the 'n' is small enough. 100*O(1) vs
1*O(n), the latter is better if n < 100.

Something that runs at O(n) but takes 1ms per n is a much worse algorithm than
something that runs at O(n) and takes 1us per n.

Both have the same O() notation, but which algorithm you use is obvious.

But Greg is right, you O notation isn't applicable here.

-- Steve



\
 
 \ /
  Last update: 2015-04-24 16:21    [W:1.244 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site