Assuming Module A is a O(k) operation you observe that J is decreasing exponentially most specifically you observe that the loop will always reapeat log n (base 2 because it is halfed at each iteration) times thus you have a time complexity of O(k*log n)