It’d be really nice if someone can take up a problem as example and explain the approach of solving it using a persistent segment tree.There are 1-2 problems on codechef but editorials of those problems explain very little about the persistence part.
e.g. for example to solve this problem(or any other problem) using persistent segment tree http://www.spoj.com/problems/MKTHNUM/
what will be the approach i.e. if someone can explain how we are building n segment trees and after that how we are querying,it’ll be very helpful.
A persistent data structure is one where you can answer queries for different versions of the data structure. Meaning you can shift between the newly updated and old versions.
For a persistent segment tree, each update costs you log(n) operations, because an update query of any range will effect at most log(n) nodes. This allows us to update the tree to a new version efficiently.
Here is a video tutorial on the exact problem you are talking about.
An MIT lecture talks about persistent data structures in general.