3 ms·
> can be implemented like a persistent data structure you don't get much benefit from persistent structures if every element of an array is modified, like in t
by perfunctory 7y ago
> can be implemented like a persistent data structure
you don't get much benefit from persistent structures if every element of an array is modified, like in the examples in the post.
- capableweb 7y agoI missed that, sorry. Thanks for clarifying!
- pipeep 7y agoIf the data structure has a reference count of one, you can safely mutate the data structure instead. Many persistent immutable data structure libraries use this as an additional optimization.