Hello. My teacher gave me a question to trace, but im not sure as why the output comes out the way it is. I tried tracing it. first you enqueue num 2 which is 1 and then followed by num2 which is 4. then comes the dequeue part where we remove the 1 and then insert num1-num2 into queue which is 4. now heres the confusing part. so far i got 4 4. but i looked online and the solution is 4 4 4. im confused as since when did num 2 and num 1 become 4? is it because of aQueue.enqueue(num1 - num2)? Thanks for any clarifications
for the first two enqueue i think u meant 1 not 2.
im good up to line 7 but the last two dequeue i still dont get. i thought 4 was num 3 so why did it go away when num1 is dequeued same for num2, it was never inserted into the queue. this is one confusing problem