The task is to sort a stack so that the top of the stack has the greatest element. You need to complete the function sort() which sorts the elements present in the given stack.
Topics
Companies
Articles
Examples:
Expected Time Complexity: O(N*N)
Expected Auxilliary Space: O(N) recursive.
Constraints:
1<=N<=100
Companies:
AmazonMicrosoftGoldman SachsIBMIntuit + 1 more
Topics:
Recursion
Please log in to access the Submissions tab, where you can review your progress and explore code submissions from other participants.
Please log in to access the Solution tab and view detailed answers and explanations.
Please log in to access the Discussion tab and join conversations with other participants.
Access Restricted: Please Login to access the code editor and test cases.