結果 : write an algorithm for basic operations on stack