Skip to content

Extend Persistent Data-Structures with Deque #48

Description

@baierd

CPAchecker implements a PersistentStack based on the PathCopyingPersistentTreeMap. This should be moved into this repository, as others can benefit from it. But since a stack (and a queue) are just special views on a deque, we can just implement a PersistentDeque and get a queue and stack out of the deque, increasing our set of persistent data-structures in a thought out way.

The PersistentDeque can be based on the PathCopyingPersistentTreeMap, like in CPAchecker, or may be based on other starting points, for example the PersistentLinkedList, to optimize the implementation.

Much more optimal solution(s) can be found for example in Implementing Persistent O(1) Stacks and Queues in R by Shawn T. O'Neil. Looking at the R code, we could try to translate the concept to Java with our PersistentLinkedList rather quickly i think.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions