Given an unsigned 16 bit integer and unlimited memory, provide an alogorithm which will determine the bits that are set.
convert the # to binary
create a character array to store the bit pattern.
parse through the array and print out the indexes of the '1's. That was it!
Originally posted by Michael Ernest:
I like the idea of a 'Programming Diversions' forum in Other, where all you brain-teaser freaks can hang out and frustrate each other beyond belief (in Java, naturally).
Naturally Jim Yingst should moderate. :roll:
Originally posted by Jason Menard:
While in essence we are discussing algorithms, I personally would avoid the term for a couple of reasons. For one thing, it can be an intimidating topic for many people. For another, algorithms don't come off as being an overly exciting topic of discussion, IMHO.
Originally posted by Jim Yingst: