Question: Consider list A=(w, x, y, z), deployed to implement a Queue Abstract Data Type. 1. Let the head of A correspond to the front position

Consider list A=(w, x, y, z), deployed to implement a Queue Abstract Data Type. 1. Let the head of A correspond to the front position of the Queue. Implement operations enqueue (el, A) and dequeue (A) using list construction operations. In both cases we can refer to as the state of the list upon successful termination of one of its operations. 2. Let us now reverse the way we manipulate our data structure and let the head of A correspond to the rear of the Queue. (a) What would be the result of cons(el, A), and would it be a correct implementation for operation enqueue (el, A)? (b) What would be the result of list(el. A), and would it be a correct implementation for operation enqueue (el, A)? (c) What would be the result of concat(list(el), A), and would it be a correct imple- mentation for operation enqueue (el, A)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
