pushing right childfirst so that left child comes first while popping .
s1 . insert ( 0 , temp1 . right ) NEW_LINE s1 . insert ( 0 , temp1 . left ) NEW_LINE temp1 = s1 [ 0 ] NEW_LINE s1 . pop ( 0 ) NEW_LINE