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:
- Understand BIT
Fenwick Tree or Binary Indexed Tree - YouTube - Range Query logic
Basic Binary Indexed Tree (English version) - Codeforces - Just code a simple inplementation
Binary Indexed Tree or Fenwick Tree | HackerEarth - Code a slightly complicated one
Binary Indexed Tree made Easy | HackerEarth - 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.
- Repeat 3-5 until you are able to code it perfectly without referring the reference material.
- Solve these to improve your concepts
Fenwick (Binary Indexed) Trees Practice Problems | Data Structures | page 1 | HackerEarth - Upvote this post if you liked it
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.
- Tushar Roy’s basics
Segment Tree Range Minimum Query - YouTube - Lazy propogation
Lazy Propagation Segment Tree - YouTube - Fast Iterative implementation of segment tree
http://codeforces.com/blog/entry/18051 - Recursive segment tree
Segment trees (for beginners) | HackerEarth - What I personally refer to
Segment Tree and Lazy Propagation | HackerEarth - 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)
- 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.