Question
Mixed Bag: This question concerns several different data structures topics in one question. (a) Consider an array-based implementation strategy for a queue, where queued integers
Mixed Bag: This question concerns several different data structures topics in one question. (a) Consider an array-based implementation strategy for a queue, where queued integers [e.g. 7, 2, 3, 5, 9 as below] are held in a fixed-size array of 6 elements, supported by two integer variables F and R representing the position of the front (0) and rear (4) of the queue in the array. Explain how simple enqueue and dequeue operations could be implemented for a linear fixed-size array such as this. You may use pseudo-code if you feel it is helpful, and you can include diagrams to help illustrate your answer. (b) There is a problem with a simple linear array-backed implementation as shown above that renders it effectively impractical. (Hint: the problem isnt the small size - its acceptable it can only hold 6 elements at any one time) i) Identify and describe the problem with this implementation. ii) Identify and describe an approach to resolve this problem whilst retaining an underlying fixed-size array. You can use diagrams as necessary to help illustrate your points (c) The acronyms FIFO and LIFO are used to describe list-like data structures. Expand these acronyms and explain which is relevant for a queue. (d) You are tasked with deciding between two possible List implementation strategies for some software youre writing. The first is Vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started