Skip to content

Commit d865dfc

Browse files
feat: Add XOR-based doubly linked list mode for memory efficiency
Implements issue #692 by adding an optional 'xor' mode to DoublyLinkedList that uses XOR of adjacent node addresses to reduce memory usage from 2 pointers to 1 pointer per node. Features: - Add mode parameter ('standard' or 'xor') to DoublyLinkedList.__new__ - Implement XOR node structure with links=['both'] - Maintain id_to_node dictionary for pointer dereferencing - Refactor all insert/extract methods for XOR mode support - Override __getitem__, __str__, and search for XOR traversal - Maintain full backward compatibility with standard mode Testing: - Add comprehensive test suite for XOR mode - Test parity between standard and XOR modes - Test edge cases (empty, single, large lists) - All 114 existing tests still pass Fixes #692
1 parent dcc0175 commit d865dfc

File tree

2 files changed

+567
-63
lines changed

2 files changed

+567
-63
lines changed

0 commit comments

Comments
 (0)