codingpython
deque - double-ended queue
Define a double-ended queue. Append 0 to the right. Append 1 to the left. Pop the element off the right. Pop the element off the left. What is the time complexity of each operation?
Define a double-ended queue. Append 0 to the right. Append 1 to the left. Pop the element off the right. Pop the element off the left. What is the time complexity of each operation?