In this post I will introduce the concept of persistent data structures. We shall deal with a couple of problems: COT, MKTHNUM
Consider the following question:
Given a linked list, you need to support 2 operations.
Thank You Anudeep
Persistent segment trees – Explained with spoj problems – Anudeep's blog
Actually BIT supports max/min queries and continuous sum( a[i] ~ a[i+L] ==> +x) queries.
We can implement by using 2 BIT.