A binary search tree that rotates after every insert and delete to keep itself balanced, guaranteeing O(log n) operations. Each node's balance factor stays within {-1, 0, 1}.
A binary search tree that rotates after every insert and delete to keep itself balanced, guaranteeing O(log n) operations. Each node's balance factor stays within {-1, 0, 1}.
Time complexity: O(log n). Space complexity: O(n).
Use the interactive visualizer above to run AVL Tree (Self-Balancing BST) on your own input and watch every comparison, swap, and operation animate step by step — pause, scrub, or replay at any speed.