Given an infinite stream of bits with bits being appended at the
highest significant position. Give an algorithm to say whether the
number formed by sequence of bits that had been processed till then ,
is divisible by 3 or not ?


My sol:

have a variable sum.......find the sum of bits....whenever u add a bit
do sum+="bit value"  ... check whether sum%3==0.....
....Is my solution ok?? anyother good solutions ??

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to