Messages in this thread | | | Date | Fri, 24 Apr 2015 10:02:06 -0400 | From | Steven Rostedt <> | Subject | Re: [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
| |