Basic solution which comes in mind is to pop all element and sort and push into Stack again.
Sort Stack in place
Basic solution which comes in mind is to pop all element and sort and push into Stack again.
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
by Dhaval Dave
The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. Good thing about a list is that items in a list
by Dhaval Dave
by Dhaval Dave
three of the most common data types used in programming: numbers, strings and booleans. We assigned those data
by Dhaval Dave
Given a sorted array and a number x, find a pair in array whose sum is closest to x.
Examples:
Input: arr[] = {10, 22, 28, 29, 32, 40}, x = 54
Output: 22 and
by Dhaval Dave
by Dhaval Dave
example
by Dhaval Dave
A class is made abstract by declaring at least one of its functions
by Dhaval Dave
Polymorphism occurs when there is a hierarchy of classes and they are related by inheritance.
C++ polymorphism means that a call to a member function will cause a different function to
by Dhaval Dave
Data abstraction refers to, providing only essential information to the outside world and hiding their background details
Any C++ program where you implement a class with public