I am not good at determining time and memory complexities and would appreciate it if someone could help me out.
I have an algorithm, here and I am not sure what its
You're really looking at log_2(k), logarithm with base 2. To change bases, you have to multiply by a constant. And since we multiply by constants anyways, O(log(n)), O(ln(n)), and O(log_2(n)) are all the same.
So why does the above method have logarithmic complexity with base 2? You're dividing k in half at every call. If you go backwards, you're multiplying by 2 at every call. Multiplying by 2 is 2^n, and log_2(n) is exactly the inverse of that.
Maybe it helps if you draw a binary tree: a tree with n nodes has height log_2(n), a tree with height n has 2^n nodes.