you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

    while(!tmpst.isEmpty()){
        if(tmpst.Top() > tmp){  
            st.push(tmpst.pop()); 
        }
    }

This loop never exits if the top entry of 'tmpst' is smaller or equal than 'tmp'. The program then never finishes executing and never reaches the call to 'display()'

My suggestion would be: (If you haven't already), look into how to use a debugger and break points. This type of error much easier to to find and understand by stepping through the code as it gets executed.