title: How to sort a stack using only stack operations?
body: <p>I found this question on the web. </p>
  
  <p>Given a stack S, write a C program to sort the stack (in the ascending
  order).
  We are not allowed to make any assumptions about how the stack is implemented. 
  The only functions to be used are:</p>
  
  <pre><code>Push
  Pop
  Top
  IsEmpty
  IsFull
  </code></pre>
  
  <p>I think we can build heap and sort it. What is optimal solution to this?</p>