How to sort a stack using only Push, Pop, Top, IsEmpty, IsFull?

前端 未结 10 2229
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 09:26

Given a stack S, need to sort the stack using only Push, Pop, Top, IsEmpty, IsFull.

Looking for most sim

10条回答
  •  天命终不由人
    2021-02-06 10:04

    techInterview Discussion - Sorting on Stack

    More pseudo than anything, but there is code examples and possible solution.

提交回复
热议问题