Queue management task | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Queue management task

Why do we set size as 0 and reserve memory from the heap in the constructor Queue()? Doesn’t that mean that we’re going to have size 0 every time we create an object? https://code.sololearn.com/cuq3IyszKJ4s/?ref=app

25th Jul 2022, 8:36 AM
2 Answers
+ 1
Yes, each new instance of Queue would have zero item, and reserved 100 slots for its items.
25th Jul 2022, 8:45 AM
+ 1
Ipang I din’t realize that’s for many queues, that was helpful, ty
25th Jul 2022, 8:55 AM