WhiteBox
DSA
Start coding DSA Beyond LeetCode System Design AI Engineering White Room
RoadmapProblem sets
Quizzes Dan Ladder Contests Templates Graph Editor
Guides Library
Login Sign up
Sign up Log in

Workspaces

Start coding DSA Beyond LeetCode System Design AI Engineering White Room

DSA

Overview Roadmap Problem sets Quizzes Dan Ladder Contests Templates Graph Editor CP Guessr

Library

Library Guides

Community

Leaderboard Contributors Refer & Earn Cosmetics

Tools

Resume Reviewer Job Boards Changelog

Arrays and searching 0/120

DSA 0 of 360 problems solved
0%
Overview

Curriculum

    1. Hashing 0/11
    2. Two pointers 0/12
    3. Sliding window 0/21
    4. Prefix sums 0/29
    5. Binary search 0/20
    6. Heaps 0/11
    7. Greedy and intervals 0/9
    8. Linked lists 0/8
    9. Data structure design
    10. Advanced
    11. Fenwick trees 0/1
      1. Point updates and prefix sums
      2. Range update, point query
      3. Coordinate compression 0/1
  1. DSA
  2. / Arrays and searching

Fenwick trees for prefix sums and updates · 2 of 3 Advanced

Range update, point query

Add to a whole range and read one value, by keeping a difference array in a Fenwick tree.

1,081 words · 5 min read

Lesson Reading3

Books1

  • Competitive Programmer’s Handbook, section 9.4 Index compression in half a page, then range updates through a difference array on an eight-value example. (opens in a new tab)

Links2

  • cp-algorithms.com Fenwick Tree Range update with point query by the same two writes, then range update with range sum using two trees. cp-algorithms.com (opens in a new tab)
  • usaco.guide Range Update Range Query Range additions with range sums, first with two binary indexed trees and then with a lazy segment tree. usaco.guide (opens in a new tab)
Lesson: Range update, point query
Overview Roadmap Problem sets Log in