This repository contains custom implementations of complex data structures in Python and Java, focusing on asymptotic efficiency, memory management, and tree-balancing algorithms.
A self-balancing Binary Search Tree (BST) that guarantees
-
Key Features:
-
Self-Balancing: Implements
left_rotateandright_rotatelogic to maintain the balance factor$[-1, 0, 1]$ . -
Rank & Select: Supports Order Statistic operations (
$k$ -th smallest element) in$O(\log n)$ by augmenting nodes with subtree sizes. -
Range Queries: Efficient
max_range(a, b)function to find properties within a specific key interval.
-
Self-Balancing: Implements
A priority queue implementation optimized for merging operations.
-
Key Features:
-
Fast Melding: Implements
meld()in$O(\log n)$ to union two heaps, a distinct advantage over standard Binary Heaps ($O(n)$). -
Decrease Key: Supports standard priority queue operations (
deleteMin,decreaseKey). - Memory Efficient: Uses a linked-node structure (parent/child/sibling pointers) for dynamic memory usage.
-
Fast Melding: Implements
| Operation | AVL Tree (Average/Worst) | Binomial Heap (Worst) |
|---|---|---|
| Insert |
|
|
| Delete | ||
| Find Min | ||
| Meld (Union) |
- Python: Import the class:
from AVLTree import AVLTree - Java: Compile with
javac BinomialHeap.java