Here is a sequence of operations:
insert 1 to the front
insert 2 to the front
insert 3 to the front
insert 4 to the front
insert 5 to the front
insert 5 to the back
insert 4 to the back
remove an element from the front
remove an element from the back
remove an element from the back
insert 5 to the back
What is the complexity of this sequence?