Function to construct a tree such that there are no two adjacent nodes with the same weight
static void construct_tree ( int [ ] weights , int n ) { int minimum = weights . Min ( ) ; int maximum = weights . Max ( ) ;