duallist
A duallist is a simple, two-list implementation of a queue used in functional programming. It stores elements in two singly linked lists, commonly called the front (F) and the back (B). The design aims to support efficient insertion at one end and removal from the other without mutating a single list on every operation.
Structure and operations: The duallist maintains two lists: the front list from which elements are removed
Performance: Each operation has amortized O(1) time. A single operation may incur O(n) time during a rebalancing
Origins and usage: The duallist is also described as a two-list queue and appears in discussions of
Relation to other structures: The duallist is closely related to the two-stack queue and to double-ended queues