next up previous
Next: Up: Previous:

Aggregate Method

Note: Not all k bits flip for each call.

Bit A[0] flips n times for n calls.

Bit A[1] flips \(\lfloor n/2 \rfloor\) times for n calls.

Bit A[2] flips \(\lfloor n/4 \rfloor\) times for n calls.

Bit A[i] flips \(\lfloor n/2^i \rfloor\) times for n calls, where i = 0, 1, ..., \(\lfloor \lg n \rfloor\).

For i > \(\lfloor \lg n \rfloor\), A[i] does not flip.


3 2 1 O
O O O O
O O O 1
O O 1 O
O O 1 1
O 1 O O
O 1 O 1
O 1 1 O
O 1 1 1
1 O O O


next up previous
Next: Up: Previous: