Menu
Tree Operations
Tree Type
Options
Navigation
Visualization Traversals History Properties Rules Tutorial Comparison

Red Blackify

"Visualize. Rotate. Learn."

Interactive tool to visualize and understand Red-Black Tree

📝 Algorithm Steps
Ready to perform operations
Select an operation to see the algorithm steps
📚 Detailed Explanation

Perform an operation to see detailed explanations of each step, including why certain actions are taken and how they maintain tree properties.

💻 Pseudocode

Pseudocode for the current operation will appear here.

🎯 Visual Indicators
Red Node - Newly inserted or needs fixing
Black Node - Balanced
Highlighted - Currently being processed
📋 Red-Black Tree Rules
Red Node
Black Node
🔍 Traversals
Traversal Type Result Action
Inorder
-
Preorder
-
Postorder
-
📜 Operation History
No operations performed yet
⚙️ Controls
Show Null Leaves:
500ms
📈 Tree Statistics
0
Nodes
0
Height
-
Black Height
📖 Tree Properties
5
Properties
Fundamental rules for balance
O(log n)
Time Complexity
Guaranteed performance
2x
Height Limit
Max 2× log₂(n+1)
1 bit
Memory
Color info per node
3
Pointers
Left, right, parent
2
Rotations
Left & right only

Red-Black Tree vs AVL Tree

Red-Black Tree
Balance Factor ±1 (approximate)
Insertion O(log n)
Deletion O(log n)
Search O(log n)
Rotations ≤ 2 rotations
Color Changes O(1)
Use Case General purpose
AVL Tree
Balance Factor Exactly ±1
Insertion O(log n)
Deletion O(log n)
Search O(log n)
Rotations Multiple rotations
Color Changes N/A
Use Case Read-heavy
Performance Analysis
Memory RB: +1 bit per node
Insert Speed RB: Faster
Delete Speed RB: Faster
Search Speed AVL: Slightly faster
Implementation RB: More complex
Tree Height AVL: More balanced
Popular Use RB: Linux scheduler