Generation and visualization of a balanced binary search tree