摘要:
//给定一个非负整数num,不用循环,返回>=num,并离num最近的,2的某次方 public static final int tableSizeFor(int n) { n--; n |=n >>>1;//>>>不带符号右移 n |=n >>>2; n |=n >>>4; n |=n >>>8 阅读全文
posted @ 2023-08-26 15:07
开源遗迹
阅读(25)
评论(0)
推荐(0)
摘要:
//统计文件夹下的文件,是文件就累计1,隐藏文件空累计,文件不累计 public static void main(String[]args) { System.out.println(getFileNumber("D:\\重要文件")); } public static int getFileNu 阅读全文
posted @ 2023-08-26 15:06
开源遗迹
阅读(22)
评论(0)
推荐(0)
摘要:
//绳子最大能盖的数组节点 public static void main(String[] args) { int[] arr = {1,4,7,9,60}; System.out.println(maxPoint2(arr,50)); } public static int maxPoint(i 阅读全文
posted @ 2023-08-26 15:03
开源遗迹
阅读(18)
评论(0)
推荐(0)

浙公网安备 33010602011771号