1.What is the time complexity (represented in terms of Big Oh) for performing a push operation when a stack is implemented using an array? Furthermore, a pointer TOS is used to track the top of the stack, and a variable maxsize to track the maximum size of the stack.
2.What is the time complexity (represented in terms of Big Oh) for performing a dequeue operation when a queue is implemented using an array? Furthermore, to track the head and tail of the queue, there are two pointers i.e. front and rear.
Sample Solution