Re: [algogeeks] Re:

2013-06-21 Thread shubham saini
)) + bitCount(n) + n + 1; } On Thursday, June 20, 2013 11:03:35 PM UTC-4, shubham saini wrote: How to count no of set bits for all numbers from 1 to n for a given n... i knew brute force any better solution ?? -- You received this message because you are subscribed to the Google Groups

[algogeeks]

2013-06-20 Thread shubham saini
How to count no of set bits for all numbers from 1 to n for a given n... i knew brute force any better solution ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email

[algogeeks] c++ this pointer

2013-06-05 Thread shubham saini
#includeiostream using namespace std; class Test { private: int x; int y; public: Test(int x = 0, int y = 0) { this-x = x; this-y = y; } void setX(int a) { x = a; } void setY(int b) { y = b; } void destroy() { delete this; coutx=this-x,y= this-y; } void print() { cout x =