How to find all "1" bits in a unsigned char bitmapRep[8192]?
Given a unsigned char bitmapRep[8192], how to efficiently find out all "开发者_运维百科1" bits' positions? Thanks.
What do you mean by "find"?
This may seem like a smart-ass answer, but I'm perfectly serious: you already have found them. There's a perfect map describing exactly where all the 1 bits are found, and it has a bit set in the corresponding positions.
Homework?
hint - Lookup table for each byte
精彩评论