A B C D E
Now perform the following operations on the Dequeue
(a) Add F on the left
(b) Add G on the right
(c) Add H on the right
(d) Delete two letters from the left
(e) Add I on the right
(f) Add J on the left
(g) Delete two letters from right
(a) Add F on the left
result: FABCDE
(b) Add G on the right
result:FABCDEG
(c) Add H on the right
result:
FABCDEGH
(d) Delete two letters from the left
result: BCDEGH
(e) Add I on the right
result: BCDEGHI
(f) Add J on the left
result: JBCDEGHI
(g) Delete two letters from right
result:JBCDEG
Comments
Leave a comment