a*******y 发帖数: 1040 | 1 1.给你两个variable, each has one byte, multiply them, how many bytes do you
need to store the result.
2. count the number of "1" in a number. I answered use num&(num-1)来count,
他说要是worst case全是1怎么办? 我说那就count "0"是不是我说错了这个optimize的
方法? | g*****g 发帖数: 34805 | 2
you
2
just shift to right for N times, I don't know how to beat that unless
you have a lookup table.
【在 a*******y 的大作中提到】 : 1.给你两个variable, each has one byte, multiply them, how many bytes do you : need to store the result. : 2. count the number of "1" in a number. I answered use num&(num-1)来count, : 他说要是worst case全是1怎么办? 我说那就count "0"是不是我说错了这个optimize的 : 方法?
|
|