4,824 reputation
22435
bio website
location Budapest, Hungary
age 25
visits member for 4 years
seen Sep 22 at 13:10

We're children. We're supposed to be childish.

http://szelei.me


Sep
24
awarded  Yearling
Sep
4
awarded  Nice Answer
Aug
17
revised Is it an anti-pattern to use void* and enums to enable type-checking?
added 140 characters in body
Aug
17
answered Is it an anti-pattern to use void* and enums to enable type-checking?
May
26
comment Why is Mercurial considered to be easier than Git?
@faif sorry, it was years ago, I don't know exactly which comparison I meant. It is more of a general sentiment though that keeps coming up (and I think this is not only my own perception since this question has gotten a lot of attention).
Mar
23
comment Representing a deck of cards in C (not C++)
Another reason to use int might be performance-related. Most architectures do best on accessing int-aligned data (though your struct might be padded to do that anyway).
Mar
7
comment Most efficient data structure for implementing inheritance structure without classes
As for the amount being stored outside the class: you could pass that as a parameter, but maybe it would make sense to store in the class? Without knowing your requirements in more detail, it's hard to tell.
Mar
7
comment Most efficient data structure for implementing inheritance structure without classes
@Garan there is actually new/different functionality, but misplaced in the calling site. You would write class-specific code outside the class, which is an antipattern. What I'm suggesting is the object oriented way of designing it.
Mar
7
answered Most efficient data structure for implementing inheritance structure without classes
Feb
10
comment Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
@delnan I honestly did not mean to nitpick; I think it is a very important distinction that we are talking about average case, not worst case. The premise of the question is false because of this. If the OP used the correct worst-case complexity, the question would have answered itself. Also, please do point out my mistakes in other comments, I do not take it personally. This is just a website where I spend some of my free time, after all. On the same note, I apologize if I happened to offend you in any way, reading back I can see how I might have come off stuck-up.
Feb
10
comment Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
@delnan citation: "A further tacit assumption is that the worst case analysis of computational complexity is in question unless stated otherwise" link
Feb
10
comment Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
@delnan Asymptotic complexity talks about worst case complexity, unless stated otherwise, and that is what Big-O is, function that is an upper bound to another (again, look it up if you don't believe me). The average case complexity of quicksort is O(n log n). You are using theta instead of omicron, which means a different thing: tight bounds, both upper and lower.
Feb
9
revised Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
fixed incorrect edit, included wikipedia quote
Feb
9
comment Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
No, quicksort is not O(n log n), it is O(n^2)! O(n log n) is the average complexity of quicksort (in number of comparisons).
Feb
9
revised Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
fixed incorrect edit, check wikipedia
Feb
9
answered Binary Search seems superior, why did the committee of C++ still have Find in the algorithm library?
Oct
9
awarded  Notable Question
Sep
24
awarded  Yearling
Jul
26
awarded  Notable Question
Jul
3
awarded  Popular Question