数据结构与算法分析(JAVA版)Chapter1练习题

/** * 类名:Test1.java * 说明:返回N的二进制的1个个数 */ public class Test5 { public static int getOne(int n){ if(n < 2) return 1; return n%2 + getOne(n/2); } /** * 函数名称:main * 说明: */ public stat
相关文章
相关标签/搜索