[刷题]O(1) Check Power of 2
来源:互联网 发布:阿里云备案转入腾讯云 编辑:程序博客网 时间:2024/05/14 09:34
[LintCode]O(1) Check Power of 2
class Solution { /* * @param n: An integer * @return: True or false */ public boolean checkPowerOf2(int n) { // 2015-09-06 if (n <= 0) { return false; } boolean res = ((n & (n-1)) == 0) ? true : false; return res; }};
0 0
- [刷题]O(1) Check Power of 2
- O(1) Check Power of 2
- lintcode: O(1) Check Power of 2
- *[Lintcode]O(1) Check Power of 2
- #142 O(1) Check Power of 2
- [Microsoft] O(1) Check Power of 2
- Lintcode142 O(1) Check Power Of 2 solution 题解
- LintCode O(1) Check Power of 2 O(1)检测2的幂次
- 142.O(1) Check Power of 2-O(1)时间检测2的幂次(容易题)
- check a int number is power of 2?
- Next Power of 2
- 1 Power of Cryptography
- Leetcode 231 and 342. Power of 2, Power of 4
- LeetCode 刷题 -- power of three
- power of 2 or not
- 326. Power of Three#1
- Ten Ways to Check if an Integer Is a Power Of Two in C
- Ten Ways to Check if an Integer Is a Power Of Two in C
- 个人网站开发1
- jquery遍历之parent()和parents()的区别及parentsUntil()方法详解
- 借助nbd修改img文件
- Linux常用命令总结
- Linux2.6.32移植到MINI2440(1)初步移植
- [刷题]O(1) Check Power of 2
- 计算机网络学习——01
- 报表性能优化方案之报表服务器优化基础讲解
- CGContext 基础知识点
- C#中动态代理与泛型函数
- I2S与pcm的区别
- qml---------------显示网络图片
- java代理模式及两种动态代理
- eclipse从数据库逆向生成Hibernate实体类