Let f be an operation whose argument and result is a queue and which is…
Let f be an operation whose argument and result is a queue and which is defined by the axioms:
f (CREATEQ) : : = CREATEQ
f (ADD(i, q)) : : = if ISEMTQ(q) then ADD (i, q)
else ADDQ (FRONT (q), (DELETEQ(ADDQ(i, q))))
If initially the queue is then what does the operation f(ADD (7, q)) will do?
- A.
Inserts ‘7’ in the middle of the queue
- B.
Insert ‘7’ at the front of the queue
- C.
Inserts ‘7’ and then reverse the queue
- D.
None of the above
Attempted by 258 students.
Sign up free to check your answer
Sign up freeLoading lesson…