4 ms·
Lookup table. Edit: I should add, the problem never said I didn't have infinite memory or computational resources.
by chipsy 14y ago
Lookup table.
Edit: I should add, the problem never said I didn't have infinite memory or computational resources.
- jiggy2011 14y agoOk, but how do you create the lookup table?
- lincolnq 14y agoI don't know, but how do you compile any of these C programs?
- johnpmayer 14y agofor i... { append i append i + 0.333 append i + 0.666 }
- jiggy2011 14y agoYou can't use the + operator.
- alex_c 14y agoMechanical Turk. A budget limit wasn't mentioned either :)
- jakejake 14y agoThis should be exactly the kind of out-of-the-box thinking that these questions find. But something tells me the person who asked this question would not have been impressed, which is sad. They probably just want someone who memorized a division implementation in assembly.
- smackmybishop 14y agoAssuming unspecified resources are infinite without confirming? This is not good problem solving. You should not be impressed.
- jakejake 14y agoThat's how brain-teaser questions usually stump me - because I impose some limitation that doesn't exist. The question had pretty specific limitations, but the amount of resources wasn't one of them. To me the answer is valid. If the interviewer wanted to see an implementation of a division function they could have just said "please implement a division function"