277 reputation
212
bio website
location
age
visits member for 4 years, 2 months
seen Dec 12 at 10:39

Jan
31
comment On which abstraction level would you do TDD?
I understand your point with integration testing. Am also familiar with mocks and stubs. But still: I change the structure of A and all of a sudden end up having to change B1 (including its interface and mock respectively) and throw away C2. I'm probably lacking experience in design and SOLID principles. Very good point in your "worth noting" addition.
Jun
20
comment What's the computational complexity of the Groovy unique() method?
@KChaloux: You may have the honors.
Jun
20
comment What's the computational complexity of the Groovy unique() method?
@KChaloux: Ok, from your comments I understand that the best implementation of unique() would have a complexity of O(n), but this particular Groovy implementation of unique() in revision 728bb83ec has a complexity of O(n^2). Thank you.
Jun
20
comment What's the computational complexity of the Groovy unique() method?
@jk.: Two nested for-loops iterating over n, so O(n^2)?
Apr
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
No, not at all. It's perfect. Thanks a bunch for asking!
Apr
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
I had come across that xkcd cartoon today while surfing the web. :-) Randall Munroe's cartoons are a delight.
Apr
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
Very understandable explanation of memoization. Above all, thank you for illustrating it with a code snippet. Also, "there's going to be a lot of repetition at the end of the sequences" made things clear for me. Thank you.
Apr
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
@MichaelT: You are correct, of course. The stack frame count is small enough with numbers less than one million. I just mentioned the Collatz problem to give some more context. But that probably was a bad idea because it has nothing to do with the actual question. But thank you for the feedback!
Apr
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
@DocBrown: Why recursively? Just for practicing recursion. :-) I had first solved it iteratively.
Apr
11
comment What methods are there to avoid a stack overflow in a recursive algorithm?
@James. Thank you. I understand iteration. I haven't quite understood memoisation. Care to add an answer explaining the latter or adding a link you found suitable for a beginner?