LeetCode 231 Power of Two
2016-03-22 23:18
477 查看
Given an integer, write a function to determine if it is a power of two.
public boolean isPowerOfTwo(int n) { return n>0 && (n&(n-1))==0; }
相关文章推荐
- 在AS中添加第三方jar和.so库
- XtraBackup出现 Can't connect to local MySQL server through socket '/tmp/mysql.sock'
- CodeForces-632A-Grandma Laura and Apples
- 作业:c++作业2-标准体重
- Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds...
- Android Stdio程序在虚拟机运行出现enabled ADB integration to be ebabled错误
- day16 分页 & 案例
- canvas(2D绘图上下文绘制文本)
- 为什么Intent传递对象的时候必须要将对象序列化呢?
- 使用passenger在Centos7部署Puma+Nginx+Ruby on Rails
- String与基本类型数据之间的转换
- (Linux上)nginx搭建rtmp协议流媒体服务器
- Andriod开发技巧——Fragment的懒加载
- shell比对文本文件
- CF 653F 后缀数组
- bzoj 3130: [Sdoi2013]费用流
- 关于数据库插入性能优化——转载自UC
- POJ 2965 The Pilots Brothers' refrigerator【BFS+状压 Or 脑洞】
- 有哪些老鸟程序员知道而新手不知道的小技巧?
- POJ 2965 The Pilots Brothers' refrigerator【BFS+状压 Or 脑洞】