随笔分类 -  bit

摘要:Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r 阅读全文
posted @ 2016-12-04 05:17 微微程序媛 阅读(140) 评论(0) 推荐(0)
摘要:Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retur 阅读全文
posted @ 2016-12-01 13:49 微微程序媛 阅读(141) 评论(0) 推荐(0)
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 1. nagitive 2. overflow Another exampl 阅读全文
posted @ 2016-11-30 09:23 微微程序媛 阅读(138) 评论(0) 推荐(0)
摘要:Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complementmethod is used. Note: Example 1: Example 2: 阅读全文
posted @ 2016-11-28 07:41 微微程序媛 阅读(209) 评论(0) 推荐(0)
摘要:The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num 阅读全文
posted @ 2016-11-27 05:43 微微程序媛 阅读(171) 评论(0) 推荐(0)