ACM-ICPC-Algorithms icon indicating copy to clipboard operation
ACM-ICPC-Algorithms copied to clipboard

Sorting Stack using recursion

Open pr4nshul opened this issue 6 years ago • 0 comments

Sort a given stack using recursion. In the recursive function use only basic functions of stack like push, pop etc. Input Format

First line contains the number of elements in stack , N. Next line contains N elements in stack from bottom to top. Constraints

0<N<10000 Output Format

Print the elements in sorted order from top to bottom.

pr4nshul avatar Oct 01 '19 19:10 pr4nshul