Sail E0 Webinar
Question
What is the time complexity for converting decimal to binary numbers?
Options:
A .  O(1)
B .  O(n)
C .  O(logn)
D .  O(nlogn)
Answer: Option C


Since each time you are halving the number, it can be related to that of a binary search algorithm, hence the complexity is O(logn).



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers