Right view of tree

why are we pushing the data in vector we can deirectly print it