Binary sort number and balanced binary tree