3 ms·
Yes, immutable data structures can be used for capturing a temporal aspect without actually needing to model it explicitly in the underlying data. Here's a doc
by nomad010 7y ago
Yes, immutable data structures can be used for capturing a temporal aspect without actually needing to model it explicitly in the underlying data.
Here's a document[1] explaining how to make a tree-like data structures persistent along with a motivating example of their use (at the end). The wikipedia page[2] for the problem also goes into other techniques and has some diagrams too.
tl;dr a naive approach to the point location query problem achieves O(N^2) space and O(logN) time per query, while simply modifying the data structure to be persistent achieves O(N) space while retaining O(logN) time per query.
[1] https://saco-evaluator.org.za/presentations/camp3_2017/persistentdatastructures.pdf https://saco-evaluator.org.za/presentations/camp3_2017/persi...
[2] https://en.wikipedia.org/wiki/Point_location https://en.wikipedia.org/wiki/Point_location