If you can't find a product below that suits you below, MIT OCW has a course on advanced data structures which covers this, they're know as persistent data structures, and the lectures on them are very informative.
Edit: The lectures: http://ocw.mit.edu/courses/electrical-engineering-and-comput...