Implementing a Priority Stack with two stacks
<p>This is how I think it's probably intended to work: You have Stack 1 that's sorted based on the priority and every time a new element comes along that should be in the middle of the stack, you pop out all the elements from Stack 1 onto Stack 2, add the element into place, and then pop all the elements from Stack 2 back to Stack 1.</p>

<p>Does anybody know a more efficient solution?</p>
