結果 : algorithm for stack operations with example