TLDR: Fully Persistent Arrays
Date: 2021-02-15 Source: https://arpitbhayani.me/blogs/fully-persistent-arrays
Overview
Explore Fully Persistent Arrays - Understand how to implement arrays that preserve all previous versions, enabling auditing and historical access. Persistent Data Structures preserve previous versions of themselves allowing us to revisit and audit any historical version.
Key Points
- returns a new array identical to array
- returns the element present at the index index
- Tree of modifications: The tree of modifications is an n-ary tree that holds all the versions of the array by storing only the modifications made to the elements.
- Implementing
create: The create function allocates a linear array of size n to hold n elements.