converting a decimal into binary in the most optimal way possible
05:07 02 Oct 2013

What is the most optimal way to convert a decimal number into its binary form ,i.e with the best time complexity?

Normally to convert a decimal number into binary,we keep on dividing the number by 2 and storing its remainders.But this would take really long time if the number in decimal form is very large.The time complexity in this case would turn out to be O(log n).

So i want to know if there is any approach other than this that can do my job with better time comlexity?

c++ bit-manipulation bit-shift