Need help in BIT

Can somebody explain “Range Updates And Range Queries in BIT”?
Can’t Understand…Please Help…

Hi @avik26091998,

I recommend you to do it in this sequence:

  1. Understand BIT
    Fenwick Tree or Binary Indexed Tree - YouTube
  2. Range Query logic
    Basic Binary Indexed Tree (English version) - Codeforces
  3. Just code a simple inplementation
    Binary Indexed Tree or Fenwick Tree | HackerEarth
  4. Code a slightly complicated one
    Binary Indexed Tree made Easy | HackerEarth
  5. You cannot become good at it unless you code it multiple times. So it’s okay to study the code from the above sites and write it on paper, if need help then check the code again.
  6. Repeat 3-5 until you are able to code it perfectly without referring the reference material.
  7. Solve these to improve your concepts
    Fenwick (Binary Indexed) Trees Practice Problems | Data Structures | page 1 | HackerEarth
  8. Upvote this post if you liked it :slight_smile:
1 Like

@obi1 great post.
Can you suggest such a post for segment tree. I know basic of segment trees like rmq, point update.

Hi @pavitra_ag,
I personally am not very good with segment trees but I can suggest you the approach I took to get started.

  1. Tushar Roy’s basics
    Segment Tree Range Minimum Query - YouTube
  2. Lazy propogation
    Lazy Propagation Segment Tree - YouTube
  3. Fast Iterative implementation of segment tree
    http://codeforces.com/blog/entry/18051
  4. Recursive segment tree
    Segment trees (for beginners) | HackerEarth
  5. What I personally refer to
    Segment Tree and Lazy Propagation | HackerEarth
  6. There’s simply no substitute to just solving it again and again using pen and paper(kinda fun doing in class when the lecture going on is pretty boring)
  7. I am currently solving these to get the hang of it
    Segment Trees Practice Problems | Data Structures | page 1 | HackerEarth
1 Like

BIT is binary indexed tree(fenwick tree) ??

Yeah In Binary Indexed Tree.