Driver Code
public static void main ( String [ ] args ) { int arr [ ] = { 7 , 3 , 9 , 13 , 5 , 4 } ; int n = arr . length ; @ SuppressWarnings ( " unchecked " ) Vector < Integer > [ ] tree = new Vector [ 4 * n + 1 ] ; for ( int i = 0 ; i < ( 4 * n + 1 ) ; i ++ ) { tree [ i ] = new Vector < > ( ) ; } buildTree ( tree , arr , 1 , 0 , n - 1 ) ;