Skip to content

Add doubly-linked list to qpi#806

Open
fnordspace wants to merge 2 commits intoqubic:developfrom
fnordspace:feature/2026-03-06-qpiLinkedList
Open

Add doubly-linked list to qpi#806
fnordspace wants to merge 2 commits intoqubic:developfrom
fnordspace:feature/2026-03-06-qpiLinkedList

Conversation

@fnordspace
Copy link
Contributor

Adds LinkedList<T, L> to the QPI — a doubly-linked list with fixed capacity L (must be power of 2).

  • O(1) addHead, addTail, insertBefore, insertAfter, remove
  • Bidirectional traversal via headIndex/tailIndex + nextElementIndex/prevElementIndex
  • Removed nodes are immediately recycled via a free list (no cleanup() needed)
  • replace() for in-place value updates, reset() to reinitialize
  • Occupied-flags bitmap for isEmptySlot() checks

…l traversal

Doubly-linked list with fixed capacity (power-of-2), immediate node recycling
via free list, and lazy allocation. Includes 32 unit tests covering all operations.
@fnordspace fnordspace self-assigned this Mar 25, 2026
@fnordspace fnordspace added the enhancement New feature or request label Mar 25, 2026
@fnordspace fnordspace added this to qubic Mar 25, 2026
@fnordspace fnordspace moved this to 👀 In review in qubic Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

1 participant