How to balance binary tree in PHP without rotating parent?
I will try to make myself as clear as possible. Based from Adjacency List Model: http://articles.sitepoint.com/article/hierarchical-data-database I need a way to balance this tree 0 / \ 1 2 / / \ 3 4 5 \ \ 6 7 to something like: 0 / \ 1 2 / \ / \ 3 ...