Back to problems

Snapshot Set Iterator

Object-Oriented Programming · Databricks · Medium

Problem Create a data structure named SnapshotSet that behaves like a set of integers and provides operations for insertion, deletion, membership testing, and obtaining an iterator over a snapshot. An iterator must represent precisely the elements that belong to the set when the iterator is created, and it must visit those elements in their insertion order. Any later updates to the set must leave that iterator's view unchanged. Implement SnapshotSet with these methods:…

Checking your access…