tree diameter modify\sorted array number added