What is the time complexity of this function?
Time complexity of mentioned algorithm is $O(1)$, because for $K&gt;100$ you have a constant operation (println), and you know: $j=3,k = 3 \cdot n / 345 \implies 100 = 3\cdot n / 345 \implies n=11500$, means for $n\ge 11500$ your algorithm has a constant running time (also other part is constant, because just for $n&lt;11500$ will be called). 

For being more clear take a look at this question.