Design a Queue data structure to get minimum or maximum in O(1) time
Problem: Design a Data Structure a SpecialQueue which supports following operations enqueue, deque, getMin() or getMax() where getMin() operation takes O(1) time.Example: Let the data to be inserted in queue be -4, 2, 1, 6Operation Queue Outputpush(4) 4 -push(2) 4, 2 -push(1) 4, 2, 1 -getMin() 4, 2, 1 1push(6) 4, 2, 1, 6 -pop() 2, 1, 6 4pop() 1, 6