Wrote APIs to get max width of tree