code for sorting a stack and implementing queue from two stacks