Question 1 A circular buffer implementation of a FIFO is never full because head
ID: 2082247 • Letter: Q
Question
Question 1
A circular buffer implementation of a FIFO is never full because head and tail pointers wrap around.
Question 1 options:
Question 2
What happens if one puts two items of different type in the same generic container? For example, with our FIFO queue, what happens with the following code?
Question 2 options:
That code does not compile: syntax error
No problem. That's what generic containers are designed for.
Nothing wrong happens on insertion, but it's usually a bad idea, because the FIFO queue does not keep track of the types of the items stored in it. We are likely to run into trouble when we try to get data out of the FIFO, or when we try to print its contents.
The program crashes when putFifo is called for the second time
A True B FalseExplanation / Answer
1. True
2. Nothing wrong happens on insertion, but it's usually a bad idea, because the FIFO queue does not keep track of the types of the items stored in it. We are likely to run into trouble when we try to get data out of the FIFO, or when we try to print its contents
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.