Quiz


1.  

What is a queue linked list?

a queue linked list is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.

2.  

How does a queue linked list differ from an array queue?

the size of a queue linked list can change during runtime. the size of an array queue is set at compile time and cannot change at runtime.

3.  

What is the benefit of using a queue linked list?

a queue linked list can expand and shrink in size when an application runs, depending on the needs of the application.

4.  

Where are new nodes added to the queue?

new nodes are added to the back of the queue.

5.  

Which node is removed from the queue when the dequeue() member method is called?

the node at the front of the queue is removed when the dequeue() member method is called.

6.  

Can a node on a queue linked list have more than one data element?

yes, a node on a queue linked list can have more than one data element if you redefine the node structure to accommodate additional data.

7.  

What form of access is used to add and remove nodes from a queue?

first in, first out is the method used to access nodes on a queue.

8.  

Why is the constructor of the QueueLinkedList class empty?

the constructor of the queuelinkedlist class is empty because initialization of data members of the linkedlist class is performed by the constructor of the linkedlist class. the constructor of the linkedlist class is called before the constructor of the queuelinkedlist class is called.

9.  

Why does the QueueLinkedList class inherit the LinkedList class?

the queuelinkedlist class inherits the linkedlist class because the linkedlist class contains data members and function members that are necessary to manage the linked list that is used for the queue.

10.  

What happens when dequeue() is called?

when dequeue() is called, the value of the data member of the node at the front of the queue is returned to the statement that called the dequeue() member function. the front node is then deleted from memory and the next node on the queue is designated the front of the queue.

Answers

1.  

A queue linked list is a data structure that organizes data similar to a line in the supermarket , where the first one in line is the first one out.

2.  

The size of a queue linked list can change during runtime. The size of an array queue is set at compile time and cannot change at runtime.

3.  

A queue linked list can expand and shrink in size when an application runs, depending on the needs of the application.

4.  

New nodes are added to the back of the queue.

5.  

The node at the front of the queue is removed when the dequeue() member method is called.

6.  

Yes, a node on a queue linked list can have more than one data element if you redefine the node structure to accommodate additional data.

7.  

First in, first out is the method used to access nodes on a queue.

8.  

The constructor of the QueueLinkedList class is empty because initialization of data members of the LinkedList class is performed by the constructor of the LinkedList class. The constructor of the LinkedList class is called before the constructor of the QueueLinkedList class is called.

9.  

The QueueLinkedList class inherits the LinkedList class because the LinkedList class contains data members and function members that are necessary to manage the linked list that is used for the queue.

10.  

When dequeue() is called, the value of the data member of the node at the front of the queue is returned to the statement that called the dequeue() member function. The front node is then deleted from memory and the next node on the queue is designated the front of the queue.




Data Structures Demystified
Data Structures Demystified (Demystified)
ISBN: 0072253592
EAN: 2147483647
Year: 2006
Pages: 90

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net