2 2 votes A double-ended queue (DEQUE) supports insertion and deletion at both ends $(f$ for front, $r$ for rear$)$. If we want to implement a STACK using this DEQUE, which of the following pairs of operations would correctly simulate the $\verb|PUSH(X)|$ and $\verb|POP()|$ behavior?$\verb|INSERT_FRONT(X)|$ AND $\verb|DELETE_REAR()|$ $\verb|INSERT_REAR(X)|$ AND $\verb|DELETE_REAR()|$ $\verb|INSERT_REAR(X)|$ AND $\verb|DELETE_FRONT()|$ $\verb|INSERT_FRONT(X)|$ AND $\verb|INSERT_REAR()|$ Programming in Python goclasses python-&-dsa goclasses-da-dpp goclasses-da-dpp-day-110 goclasses-python-&-dsa-practice-questions + – GO Classes 192 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote (A) INSERT_FRONT / DELETE_REAR: This is FIFO behavior (Queue).(B) INSERT_REAR / DELETE_REAR: This is LIFO behavior. The most recent element added to the rear is the first to be removed from the rear. CORRECT.(C) INSERT_REAR / DELETE_FRONT: This is FIFO behavior (Queue).(D) INSERT_FRONT / INSERT_REAR: These are two insertion operations; no deletion is defined to simulate a POP. GO Classes answered Feb 27 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.