Open pr4nshul opened 4 years ago
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.
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.