What is the most efficient way to count the number of bits
which are set in a value?
Answer Posted / boomer
pseudo
int size is 32 bits...right?
for(i = 0 to 31)
{
count += (value & 1) //& = and oprator
shift left value
}
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is a method in c?
What is the purpose of void pointer?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
What is modeling?
What is a class c rental property?
What is the size of structure in c?
What is logical error?
Is c compiled or interpreted?
Is there any demerits of using pointer?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
What are c header files?
What is the purpose of void in c?
What are file streams?
What does double pointer mean in c?
What are 'near' and 'far' pointers?