Turn Log2 Iterativ into Recursiv way

后端 未结 0 467
小鲜肉
小鲜肉 2021-01-19 00:05

I thought about a simple Task which is to calculate Log2 in an iterative way like:

public static int log2(int x) {
    int result = 0;

    while (x > 1) {         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题