If top of the stack will be at position 0, then time complexity for operations: 1. push() : O(n) => you need to pop all elements then push at postion 0 then again insert all poped elements 2. pop() : O(n) => first go to postion 0 then push all other elemnts 3. top() : O(n) => pop all other elements to get 0th element Solution If top of the stack will be at position 0, then time complexity for operations: 1. push() : O(n) => you need to pop all elements then push at postion 0 then again insert all poped elements 2. pop() : O(n) => first go to postion 0 then push all other elemnts 3. top() : O(n) => pop all other elements to get 0th element.