Reputation
3,175
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
12 17
Newest
 Nice Answer
Impact
~152k people reached

1d
revised Word game algorithm
Added small space optimisation.
1d
comment Word game algorithm
More space-efficient, for sure (you're trading an M-character string for a single character and a small-ish integer)
1d
answered Word game algorithm
1d
comment Interview question on accessing variable with pointers in c
Or possibly p--, depending on the direction of the stack. It is, however, relying on undefined behaviour, so...
Jan
14
comment Is it effective to review code in language I don't know?
@BЈовић Nope, it's not the worst you can find, but it is pretty close to "the smallest thing found that is still worthwhile".
Jan
14
comment Is it effective to review code in language I don't know?
@BЈовић And if the only comment is of the form "wouldn't variable flugh be better named bloops, as you have typed it as a bloop and it's an array?" ?
Dec
31
comment Does it make sense to use the term “Space Leak” with regard to Java?
I tend to use one of "unintentional liveness" (there's one or more references to an object, keeping it live, even though it is no longer needed) or "GC bug" (if the object is no longer reachable, but still cannot be collected).
Dec
13
reviewed Reject What is the history of why bytes are eight bits?
Nov
27
answered Should I use TDD and BDD if my project is changing fast?
Nov
18
answered Is measuring the binary size of a c++ program a good indication of code complexity? Or something else?
Nov
11
awarded  Nice Answer
Nov
10
answered Two structs with the same members but different naming, is it a good idea?
Oct
28
comment Does extending a ruby class violate the LSP?
I suspect Cat and Mammal are better examples than Room and House. Sub-classes should, in general, follow an "is-a" relation (so, neither a "has-a" or "exists-in").
Oct
27
answered Does extending a ruby class violate the LSP?
Oct
27
answered Is it a good practice to run unit tests in version control hooks?
Oct
16
comment How does google calculate travel distance/time
@HugoDelsing Have a couple of tens of thousands of "route-finder nodes", able to speak a common RPC protocol. Send "navigate from A to B" to a couple of hundred (with different biasing), have them compute routes and send best-so-far route (and cost) back to the controlling node. Periodically update them with cost of cheapest route found so far. Allow, say, 0.5 - 1 s from "start of tracking" to "you're done now". Pick the cheapest route found. Don't underestimate what you can do when you can throw insane amounts of CPU, disk and RAM at problems.
Oct
16
comment How does google calculate travel distance/time
@HugoDelsing "Cheapest route between A and B" is a completely different problem from "Cheapest route between N points". The first has some pretty good applicable heuristics ("never move sufficiently straight back to A" would be one), the second is NP-complete.
Oct
12
awarded  Yearling
Sep
22
comment Why does `length - 2` recursively give you the center of a linked list?
@OmarK No, you subtract two because the list you are interested in is two elements shorter (it is without "the first" and "the last" element). This is independent of if the list "index" (these look as if they could well be implemented with linked lists) being 0-based or 1-based. After all, if I have a list [1, 2, 4] or a list [0, 1, 2, 3] (both length 4) both [2, 3] and [1, 2] are lists of length 2, as well as being the previous lists with the first and last element removed.
Sep
21
answered Is the `<table>` tag and `display:table` a functional or a layout directive?