Create a vector of n + 1 nodes of type " node " The zeroth position is just dummy ( 1 to n to be used )
ArrayList < Node > nodes = new ArrayList < Node > ( ) ; for ( int i = 0 ; i < n + 1 ; i ++ ) { nodes . add ( new Node ( ) ) ; }