Infosys interview question

Write Algo for stack implementation