B-Tree with Splay Optimization
Features
- โ Configurable N-way branching (min degree โฅ 2)
- โ Splay-like node promotion for hot data
- โ Thread-safe operations with mutexes
- โ Real-time async operations with callbacks
- โ Interactive macOS GUI visualization
make && ./BTreeVisualizer
Dynamic N-Way Splay Tree
Rsync Optimized
- โ Dynamic N-way branching (2 to N, adaptive)
- โ Full splay operations (Zig, Zag, Zig-Zig, etc.)
- โ Rolling checksums (Adler-32 variant)
- โ Block metadata and matching
- โ Real-time visualization with access counts
make splay && ./NSplayTreeVisualizer
Complexity
- Search: O(log n) amortized
- Insert: O(log n) amortized
- Delete: O(log n) amortized
- Space: O(n)
Circular Buffer Splay Tree
Features
- โ Fixed-size circular buffer for memory efficiency
- โ Self-adjusting splay tree operations
- โ Multiple sorting modes (lexicographic, numeric, semantic)
- โ Ascending and descending sort support
- โ LRU eviction policy when buffer is full
- โ Thread-safe operations with mutex locks
#include "CircularBufferSplayTree.h"
Complexity
- Search: O(log n) amortized
- Insert: O(log n) amortized
- Delete: O(log n) amortized
- Sort: O(n) or O(nยทk) for variable keys
- Space: O(bufferSize)
Sorting Modes
๐ Lexicographic
String-based alphabetical comparison for text data
๐ข Numeric
Standard numeric comparison for integer/float keys
๐ง Semantic
Custom comparison function for domain-specific ordering
Interactive Visualizations
Nodes:
0
Height:
0
Operations:
0
Complexity Analysis
| Operation | B-Tree | N-Way Splay Tree | Circular Buffer Splay | Space |
|---|---|---|---|---|
| Search | O(log n) | O(log n) amortized | O(log n) amortized | O(n) |
| Insert | O(log n) | O(log n) amortized | O(log n) amortized | |
| Delete | O(log n) | O(log n) amortized | O(log n) amortized | |
| Sort (Asc/Desc) | O(n) | O(n) | O(n) or O(nยทk) | |
| Sort Modes | - | - | Lex/Num/Sem |
About
This project implements high-performance tree data structures with multithreaded operations and real-time GUI visualization for macOS.
Copyright (C) 2025, Shyamal Suhana Chandra. All rights reserved.
Technology Stack
C++
Objective-C
TypeScript
JavaScript
Canvas API
Jekyll
GitHub Pages