⟩ Counting set bits in a number
First version:
int CoutSetBits(int Num)
{
for(int count=0; Num; Num >>= 1)
{
if (Num & 1)
count++;
}
return count;
}
Optimized version:
int CoutSetBits(int Num)
{
for(int count =0; Num; count++)
{
Num &= Num -1;
}
}
First version:
int CoutSetBits(int Num)
{
for(int count=0; Num; Num >>= 1)
{
if (Num & 1)
count++;
}
return count;
}
Optimized version:
int CoutSetBits(int Num)
{
for(int count =0; Num; count++)
{
Num &= Num -1;
}
}
How to count number of HTML pages in a website
What is the main difference between portability and Platform independent?
Which technology is better for a real time financial application?
Explain in type2 dimension/flag current mapping there are three data flows i.e1. data flow for new rows2 .data flow for changed row3. data flow for updated changed rowwhats the difference between last two data flow?
Tell me what are things that a Business Analyst needs to consider while doing production support?
Explain how Search engines work?
Explain what is port? what is HTTP port, FTP port, Telnet port and others?
What is the client business process in electronic industry (in mySAP CRM)?
How to remove a column from table?
Tell me what is the difference between Client response time and Server response time?