367 reputation
212
bio website iphonegamedev.stackexchange.c…
location
age
visits member for 4 years, 3 months
seen Oct 9 '11 at 21:28

Feb
26
comment Card deck and sparse matrix interview questions
@Renesis ok added them.
Feb
26
comment Card deck and sparse matrix interview questions
This is an important point. The implications are on the probability of shuffling each card being the same... I did manage to mention this.
Feb
25
comment Card deck and sparse matrix interview questions
I meant O(1) additional space (so not counting the space of the array you're given). Regarding your shuffle algorithm: I was thinking about implementing it with some tricky/clever indices into the original array. For example you can have an index to the "top" of the first "stack", an index to the "top" of the second stack and then do some clever swapping of values when shuffling. This approach is vaguely like performing heap-sort on an array with only O(1) additional space... i.e. it involves some clever swapping of values in the array.
Feb
25
comment Card deck and sparse matrix interview questions
Thanks for the reply. Your card shuffling algorithm sounds neat. Would be fun to try to implement it in O(n) time and O(1) space like the Knuth shuffle algorithm: tekpool.wordpress.com/2006/10/06/…
Feb
6
comment At what point does “constructive” criticism of your code become unhelpful?
It's true that standards should be respected. However she clearly demonstrates that it's not really a standard (previous developers didn't adhere to it). Hence her coworkers imposing the "standard" on her (without saying something like "hey look... we know it seems inconsistent but we're really trying to improve our code base") is hypocritical and unhelpful. When coworkers act like this you need to take a different, smarter approach.
Feb
6
comment At what point does “constructive” criticism of your code become unhelpful?
Trying to follow some "standard" to the "T" when one is dealing with dorks like she describes won't do much good. It'll be an endless argument over definitions and semantics.