Question: Task 1 : The snake with one field in the lecture was limited . Write a version flex _ queue of the queue, which allocates

Task 1: The snake with one field in the lecture was limited. Write a version
flex_queue of the queue, which allocates new memory if the queue becomes full. Realise
realise this in the flexqueue.h and flexqueue.cpp files. Use prototypes for the flex_queue functions in the header. We double the capacity of the queue.
At the same time, the capacity of the queue should decrease again if the utilisation of the queue falls below
25 per cent of the capacity by half. We start with a capacity of 8
and will never have less than 8 elements.
Test your implementation in the fqmain.cpp file by first inserting 1000 elements and then removing them again. The same elements must appear in the same order
occur. Check the changed capacities and make sure that there are no memory problems.
memory problems. Then do this again, but after adding 10 times, remove
always remove 5 first.
please solve this as simple as possible with c++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!