174k views
2 votes
What is the total running time of counting from 1 to n in binary if the time needed to add 1 to the current number i is proportional to the number of bits in the binary expansion of i that must change in going from i to i + 1?

User Louis W
by
5.2k points

1 Answer

5 votes

The running time would be about 67minutes

User Evorage
by
4.9k points