3
TreeMap<Integer, Integer>[] snapshotArray;6
public SnapshotArray(int length) {7
snapshotArray = new TreeMap[length];8
for (int i = 0; i < length; i++) {9
snapshotArray[i] = new TreeMap();14
public void set(int index, int val) {15
snapshotArray[index].put(currSnapId, val);22
public int get(int index, int snap_id) {23
Integer lowerKey = snapshotArray[index].floorKey(snap_id);25
if (lowerKey != null) {26
return snapshotArray[index].get(lowerKey);33
* Your SnapshotArray object will be instantiated and called as such: SnapshotArray obj = new34
* SnapshotArray(length); obj.set(index,val); int param_2 = obj.snap(); int param_3 =35
* obj.get(index,snap_id);