Any good algorithm to balanced a strict binary tree for a ordered set
Hi,
I have created a syntax tree of a binary operator that is associative but not commutative. The resultant is a unbalanced strict binary tree.
I have tried using AVL tree as well as a heap. But they will occasionally destruct the non-commutative property of the syntax tree.
Is there any efficient algorithm that I can used to balance this tree?
Thank you.

