Rebalancing an Arbitrary Binary Search Tree
Rebalancing an Arbitrary Binary Search Tree: a task in Terminal-Lego-15k (Harbor dataset). You are given an arbitrary Binary Search Tree (BST) that may be unbalanced. Your task is to implement a solution that rebalances the BST to make it as balanced as possible (a height-balanced BST).
The task
You are given an arbitrary Binary Search Tree (BST) that may be unbalanced. Your task is to implement a solution that rebalances the BST to make it as balanced as possible (a height-balanced BST).
Part of PrimeIntellect/Terminal-Lego-15k.