Plug topics

Sasha Pachev sasha at asksasha.com
Tue Jun 11 12:05:15 MDT 2013


>Remember when PLUG actually discussed Linux issues, before turning
>into BYUTV (or the 700 Club)?
>I miss the good old days :(

I think you have a good point. While I enjoy wild discussions and at times
throw in some thoughts that keep them going, I would like to see the higher
rate of technical to philosophical. So, I suppose, if you want to see
something, you need to take a step towards making it happen. My personal
style is  to throw out challenges. So here is an algorithmic challenge.

Part 1 - easy, you frequently see this in job interviews. Maybe not anymore
because everybody knows it. You have a list of N unordered elements that
contains unique numbers from 1 to N+1 with one missing. Using the amount of
RAM that will be the same regardless of N can you find the missing number
in one pass? Hint if you need one - remember how Gauss annoyed his math
teacher.

Part 2 - harder - can you do this if two numbers are missing?  Is your
solution robust enough to avoid register overflow? Can you do it without
resorting to BigInt arithmetic?

-- 
Sasha Pachev

Fast Running Blog.
http://fastrunningblog.com
Run. Blog. Improve. Repeat.


More information about the PLUG mailing list