Блог пользователя tee_01

Автор tee_01, история, 4 месяца назад, По-английски

Fenwick Trees are often introduced as a compact implementation trick for prefix sums.

But the interesting part is not the code. The interesting part is the binary structure underneath:

why ranges partition the way they do what i & -i is actually extracting how prefix traversal emerges naturally from binary decomposition why both updates and queries become logarithmic

I made a video trying to build intuition for these ideas visually and structurally rather than treating BIT as something to memorize.

Topics covered:

  • naive approaches and prefix sums
  • lowest set bit (LSB)
  • derivation of i & -i
  • block size interpretation
  • traversal logic
  • implementation walkthrough

Video: YouTube link Would genuinely appreciate feedback from experienced CP users on the content, and from people learning if its easier to understand especially if there are cleaner ways to think about or explain the structure.

References:

  • Проголосовать: нравится
  • +28
  • Проголосовать: не нравится

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Don't know whether it's mentioned in the video, but I love the idea that the structure of Fenwick tree is basically the segment tree with every right segment removed.

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by tee_01 (previous revision, new revision, compare).