We maintain two reference variables for a singly linked list implementation of a queue, one for the front and the other for the rear of the queue. Efficiency considerations dictate which end should be used for the enqueue operation and which end should be used for the dequeue operation Are the same decisions indicated if a doubly linked list is used instead of a singly linked list?.
What will be an ideal response?
No. The efficiency issue with a singly linked list is with the dequeue operation. If the element to be
removed is at the rear of the linked list, then a list traversal must take place in order to determine the node in the list that
precedes the node to be removed. This traversal makes the dequeue operation O(n). It is more efficient to remove from the
front of the linked list.
You might also like to view...
In the client/server model, documents and data files are typically stored on the client computer.
Answer the following statement true (T) or false (F)
You use the keys on the navigation keypad to move the ____________________ on the screen.
Fill in the blank(s) with the appropriate word(s).
Which of the following data types can contain a real number?
A. int B. float C. bool D. char
Open the ___________ panel and click File Properties to view information about a file in Adobe Bridge.
Fill in the blank(s) with the appropriate word(s).