1. Program to implement 2 stacks in a single array.
Anonimo
Divide the array in 2 and whenever the element is pushed in the second array we need to shift the second stack elements by one. But this is highly inefficient. Later I realized better solution is to create one stack to the extreme left of an array (arr[0]) and other is to start from the extreme right of an array arr[n-1]. The next element will be pushed in the second stack at arr[n-2].