博客
关于我
【二进制求反序】LeetCode初试验_Reverse Bits
阅读量:209 次
发布时间:2019-02-28

本文共 1101 字,大约阅读时间需要 3 分钟。

??????????LeetCode?????????????????????????????Reverse Bits????????????????????????????????????

?????????32??????????????????????43261596?????????00000010100101000001111010011100??????964176192?????00111001011110000010100101000000????????????????

?????????????????????????????????????????????????32??????32???????????????????????????

?????????????3ms???????????????????????????????????????????????????????

???32???????????????????????????????????????????????????????????????32???????????

???????res??????n???????????????res?????res << 1?????n?????n & 1??????????????n?????n >>= 1??????????????????

????????32??????????????????????

uint32_t reverseBits(uint32_t n) {    int i;    uint32_t res = 0;    for (i = 0; i < 32; i++) {        res = (res << 1) ^ (n & 1);        n >>= 1;    }    return res;}

???????????32????????????????????????????????????????????10????

???????????????????????????n?0????????????????32???????????????????????32????????

????????????????????????????????????????????????????????????????????????????????

???????????????????????????????????????????????????????????????????????????

转载地址:http://epwi.baihongyu.com/

你可能感兴趣的文章
oracle dblink 创建使用 垮库转移数据
查看>>
oracle dblink结合同义词的用法 PLS-00352:无法访问另一数据库
查看>>
Oracle dbms_job.submit参数错误导致问题(ora-12011 无法执行1作业)
查看>>
oracle dg switchover,DG Switchover fails
查看>>
Oracle EBS环境下查找数据源(OAF篇)
查看>>
Oracle GoldenGate Director安装和配置(无图)
查看>>
oracle script
查看>>
Oracle select表要带双引号的原因
查看>>
Oracle SOA Suit Adapter
查看>>
Oracle Spatial空间数据库建立
查看>>
UML— 活动图
查看>>
Oracle Statspack分析报告详解(一)
查看>>
oracle where 条件的执行顺序分析1
查看>>
oracle 使用leading, use_nl, rownum调优
查看>>
Oracle 写存储过程的一个模板还有一些基本的知识点
查看>>
Oracle 创建 DBLink 的方法
查看>>
oracle 创建字段自增长——两种实现方式汇总
查看>>
Oracle 升级10.2.0.5.4 OPatch 报错Patch 12419392 Optional component(s) missing 解决方法
查看>>
oracle 可传输的表空间:rman
查看>>
Oracle 启动监听命令
查看>>