[algogeeks] Rope Data Structure Implementation

2013-05-17 Thread Nishant Pandey
I want to implement rope data stucture from scratch in c , is there any good material that can help me implement this with ease. Thanks Nishant -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving

[algogeeks] Re: count number of set bits in an (big) array (Asked in Google interview)

2013-05-17 Thread bhargav
as bitwise operators are fast can count by following logic, works oly fr +ve, just a tweak will make it to work with -ves also .. #include stdio.h main() { unsigned int x=12312,a; a=x1; //printf(%u,a); int count=0; while(x0) { a = x1; //printf(%u \n,a); if(ax) count++; x=a; } printf(%d\n,count

[algogeeks] Re: count number of set bits in an (big) array (Asked in Google interview)

2013-05-17 Thread Don
Counting the set bits in one integer is not the problem which was asked. However, I think that something like this is both faster and more easy to understand than what you have written: int bitCount(unsigned int x) { int result = 0; while(x) { if (x 1) ++result; x = 1; }

[algogeeks] Re: Rope Data Structure Implementation

2013-05-17 Thread Don
http://en.wikipedia.org/wiki/Rope_(data_structure) I don't know if this will make it easy, but it should help. On May 17, 4:28 am, Nishant Pandey nishant.bits.me...@gmail.com wrote: I want to implement rope data stucture from scratch in c , is there any good material that can help me implement