Finally pop all Nodes from stack and prints them .
vector < int > v = s . top ( ) ; s . pop ( ) ; for ( int i = 0 , j = v . size ( ) - 1 ; i < j ; ++ i ) { cout << v [ i ] << " ▁ " << v [ j ] << " ▁ " ; j -- ; } }