• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/15

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

15 Cards in this Set

  • Front
  • Back

True or False: Queues use FIFO (first in first out) to handle add processing.

True

What is the main condition for adding to a Queue?

Items must be added at the opposite end that they are removed from.

Why can it be problematic to implement a Queue using an array?

Limited capacity -- eventually the end will be reached.

The 2 properties that comprise a Queue Node are:

- value


* Data stored on the node




- next


* Pointer to the next node in the queue

True or False: A Queue Node's 1 constructor accepts a value and a next pointer.

True

What are the main differences between a Queue and a Stack

- Queue adds to one end and removes from the other, while Stack adds and removes to the same end.




- Queue uses getNext() while Stack uses getPrevious()




- Queue uses setNext() while Stack does not contain any set methods.

True or False: A true Queue only allows addition to one end and removal and processing on the other end of the list.

True

The 3 properties that comprise a Queue are:

- Head


- Tail


- Size

True or False: A Queue's 1 constructor accepts no parameters to create an empty Queue.

True

The private methods significant to Queue are:

- enqueue(object)


*Add a new object to the Queue.




- dequeue()


* Removes the first object on the queue and returns it for processing.




- front()


* Returns the first object on the Queue.





True or False: All Queue operations are O(1)

True

True or False: A Breadth First Search checks each possible location for the exit before going further, therefore guarantees the shortest exit is found.

True

Java supplied methods for Queues include:

- add (element)


* Equivalent to enqueue (element).




- offer (element)


* Similar to add(element) with the exception of return type.




- remove()


* Retrieve and remove the first item in line from the Queue.


* Throws exception if Queue is empty.




- poll ()


* Retrieve and remove the first item in line from the Queue.


* Returns null if Queue is empty.




- element()


* Equivalent to Queue's front() method.


* Throws exception if Queue is empty.




- peek()


*Similar to the Queue front() method.


*Returns null if Queue is empty.

True or False: Inner classes should never be public.

True



What would be the name of a Queue's inner Node generated class file?

Queue$Node.class