Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Stack Adobe Amazon

Design a stack that supports getMin() in O(1) time and O(1) extra space

Question: Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() whi...
Recursion Stack Amazon

Sort a stack using recursion

Given a stack, sort it using recursion. Use of any loop constructs like while, for..etc is not allowed. We can only use the following ADT functions on Stack S: is_em...
Recursion Sorting Stack

Sort a stack using a temporary stack

Given a stack of integers, sort it in ascending order using another temporary stack. Examples: Input : [34, 3, 31, 98, 92, 23] Output : [3, 23, 31, 34, 92, 98] Input...

Subscribe to Our Newsletter