From my understanding, the complexity of the algorithm is O(number of inputs * number of bits for input)
.
The number of bits in binary notation is obviously less than the number of bits in unary notation. Then why is it that for binary, complexity is exponential but for unary, it is polynomial?
EDIT: I think the binary time is still faster. It just appears to be faster in case of unary due to notations. If x bits are used, then n has to be less than equal to x. So it becomes polynomial. while in case of binary, it's obviously O(n*2^number of bits). There might be something wrong in my explanation. Feel free add an answer to correct it.