Question 4 (1 point) Which of the following describes what Is needed to implemen
ID: 3732008 • Letter: Q
Question
Question 4 (1 point) Which of the following describes what Is needed to implement a queue using an array? O An array indexis needed to keep track of the top of the queue. O An array index is used to locate where the front of the queue is which is where items are enqueued. An array index is used to locate where the back of the queue is which is where items are dequeued. o An array index is used to keep track of the frnt of th the queue. e queue and a separate array index is used to keep track of the back of Save Question 5 (1 point) wour eae tNodit reterence Veriable front end back, which of the folowing Given a linked list implementation of a queue, where front.next- new Node (value): back back.next; back-back.next; back.data- value front.dato value front front.next Save Question 6 (1 point)
Explanation / Answer
1)-An array index is used to keep track of the front of the queue and a separate array index is used to keep track of the back of the queue. It is the correct option because for creating a queue using array we have to manage both front and rear.
2)-back.next=new Node<T>(value);
back=back.next;
This is the correct option because in queue for insertion we extending back.
3)-front=front.next;
This is the correct option because for dequeue operation we are using the front.
5)-All of these because for managing queue we need front, back and if it is returning size we keep track the size by counting size while insertion and deletions.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.