MOAL.data_structures package¶
Subpackages¶
- MOAL.data_structures.abstract package
- Submodules
- MOAL.data_structures.abstract.array_and_linked_lists module
- MOAL.data_structures.abstract.container module
- MOAL.data_structures.abstract.list module
- MOAL.data_structures.abstract.map module
- MOAL.data_structures.abstract.priority_queue module
- MOAL.data_structures.abstract.queues module
- MOAL.data_structures.abstract.queues_stdlib module
- MOAL.data_structures.abstract.set module
- MOAL.data_structures.abstract.stack module
- MOAL.data_structures.abstract.stack_frame module
- MOAL.data_structures.abstract.stream module
- MOAL.data_structures.abstract.string_adt module
- MOAL.data_structures.abstract.tree module
- MOAL.data_structures.graphs package
- Submodules
- MOAL.data_structures.graphs.adjacency_list module
- MOAL.data_structures.graphs.adjacency_matrix module
- MOAL.data_structures.graphs.binary_decision_diagram module
- MOAL.data_structures.graphs.graph_structured_stack module
- MOAL.data_structures.graphs.graphs module
- MOAL.data_structures.graphs.hypergraph module
- MOAL.data_structures.graphs.incidence_matrix module
- MOAL.data_structures.graphs.multigraph module
- MOAL.data_structures.graphs.scene_graph module
- MOAL.data_structures.hashes package
- MOAL.data_structures.linear package
- Subpackages
- MOAL.data_structures.linear.array package
- Submodules
- MOAL.data_structures.linear.array.circular_buffer module
- MOAL.data_structures.linear.array.control_table module
- MOAL.data_structures.linear.array.gap_buffer module
- MOAL.data_structures.linear.array.hashed_array_tree module
- MOAL.data_structures.linear.array.image_array module
- MOAL.data_structures.linear.array.linear_trees module
- MOAL.data_structures.linear.array.sparse module
- MOAL.data_structures.linear.array.suffix_arrays module
- MOAL.data_structures.linear.bitarray package
- MOAL.data_structures.linear.lists package
- MOAL.data_structures.linear.array package
- Subpackages
- MOAL.data_structures.other package
- MOAL.data_structures.trees package
- Submodules
- MOAL.data_structures.trees.avl_trees module
- MOAL.data_structures.trees.binary_search_trees module
- MOAL.data_structures.trees.binary_trees module
- MOAL.data_structures.trees.cartesian_trees module
- MOAL.data_structures.trees.heaps module
- MOAL.data_structures.trees.merkle_tree module
- MOAL.data_structures.trees.order_statistic_bst module
- MOAL.data_structures.trees.radix_tree module
- MOAL.data_structures.trees.splay_trees module
- MOAL.data_structures.trees.suffix_tree module
- MOAL.data_structures.trees.trie module
Submodules¶
MOAL.data_structures.persistent module¶
-
class
MOAL.data_structures.persistent.
ConfluentlyPersistentFatNode
[source]¶ Bases:
MOAL.data_structures.persistent.ConfluentlyPersistentNode
From Wikipedia:
“Fat node method is to record all changes made to node fields in the nodes themselves, without erasing old values of the fields. This requires that we allow nodes to become arbitrarily ‘fat’.
Each extra field value has an associated field name and a version stamp which indicates the version in which the named field was changed to have the specified value.
Besides, each fat node has its own version stamp, indicating the version in which the node was created. In order to navigate through the structure, each original field value in a node has a version stamp of zero.”
-
class
MOAL.data_structures.persistent.
ConfluentlyPersistentNode
[source]¶ Bases:
MOAL.data_structures.persistent.FullyPersistentNode
From Wikipedia: “If there is also a meld or merge operation that can create a new version from two previous versions, the data structure is called confluently persistent.”
-
class
MOAL.data_structures.persistent.
ConfluentlyPersistentPathCopyingFatNode
[source]¶ Bases:
MOAL.data_structures.persistent.ConfluentlyPersistentFatNode
,MOAL.data_structures.persistent.ConfluentlyPersistentPathCopyingNode
TODO
-
class
MOAL.data_structures.persistent.
ConfluentlyPersistentPathCopyingNode
[source]¶ Bases:
MOAL.data_structures.persistent.ConfluentlyPersistentNode
TODO
-
class
MOAL.data_structures.persistent.
FullyPersistentNode
[source]¶ Bases:
MOAL.data_structures.persistent.PartiallyPersistentNode
From Wikipedia: “The data structure is fully persistent if every version can be both accessed and modified.”
-
class
MOAL.data_structures.persistent.
PartiallyPersistentNode
[source]¶ Bases:
MOAL.data_structures.persistent.PersistentDataStructure
From Wikipedia:
“In computing, a persistent data structure is a data structure that always preserves the previous version of itself when it is modified. Such data structures are effectively immutable, as their operations do not (visibly) update the structure in-place, but instead always yield a new updated structure.
A data structure is partially persistent if all versions can be accessed but only the newest version can be modified.”
MOAL.data_structures.retroactive module¶
-
class
MOAL.data_structures.retroactive.
FullyRetroactiveNode
[source]¶ Bases:
MOAL.data_structures.retroactive.RetroactiveNode
,MOAL.data_structures.persistent.ConfluentlyPersistentFatNode
-
_update_retroactive
(key)¶
-
-
class
MOAL.data_structures.retroactive.
PartiallyRetroactiveNode
[source]¶ Bases:
MOAL.data_structures.retroactive.RetroactiveNode
From Wikipedia:
“In computer science a retroactive data structure is data structure which supports efficient modifications to a sequence of operations that have been performed on the structure. These modifications can take the form of retroactive insertion, deletion or updating an operation that was performed at some time in the past.”
The notion of temporal updates is probably intuitive, especially the idea of cascading changes, but what is probably confusing (at least was for me) is how this translates into something real.
For example, if one element changes, and the rest are also supposed to change as a result, what exactly should these other elements change to? It’s one thing to say “update node X[0]’s value with y”, but how does that translate for X[1], X[2], etc...? I think the point here is that it depends on your own personal use-case and context.
For example, if you are using something like git, and you need to update the references when something changes, you can implement your own method of temporal updates on the data structure.
Or, let’s say you are maintaining some numerical values that have special properties, you can go back and recalculate each one.
Or apply a hash function, or some other modifier for each element. Or just update the time-stamp.
Hopefully that makes sense!
-
class
MOAL.data_structures.retroactive.
RetroactiveNode
[source]¶ Bases:
MOAL.data_structures.persistent.FullyPersistentNode
Piggybacking on the existing classes from previous examples, we just use the Partial/Full persistent classes for each of these. The only difference is the addition of temporal updates across all nodes.