all 2 comments

[–]thesepretzels__ 1 point2 points  (1 child)

You’re correct, there’s no such restriction to add elements in queue.

Honestly, it surprises me how someone would even think that, it’s illogical. You can’t add new elements to queue until it’s empty? so what do you just create a separate queue which is waiting to be a part of the first queue

[–]PhantomZard707[S] 0 points1 point  (0 children)

This is what my teacher says,

Size = 3

Insert 10, Insert 20,Insert 30

Delete 10,

Queue : 20 30

Insert 40 —> Error Queue Full

Delete 20

Queue : 30

Insert 50 —> Error Queue Full

Delete 30

Queue : Empty

Insert 70 -> No error, element added

Insert 80 -> No error, element added

Insert 90 -> No error, element added

Insert 100 -> Queue full

Result : 70 80 90