Exam 15: The Java Collections Framework

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following statements about manipulating objects in a map is NOT correct?

(Multiple Choice)
4.9/5
(38)

Select an appropriate expression to complete the following method, which is designed to visit the elements in theList and replace each occurrence of the string "hello" with the string "goodbye". public static void helloGoodbye(LinkedList<String> theList) { ListIterator<String> iterator = theList.listIterator(); While (iterator.hasNext()) { If (iterator.next().equals("hello")) { _____________________________ } } }

(Multiple Choice)
4.9/5
(38)

Consider the following code snippet: Map<String, Integer> scores; You expect to retrieve elements randomly by key, and want fastest retrieval times. Which of the following statements will create a structure to support this?

(Multiple Choice)
4.8/5
(39)

Which of the following statements about linked lists is correct?

(Multiple Choice)
4.8/5
(37)

Which of the following statements about the TreeSet class is NOT correct?

(Multiple Choice)
4.7/5
(27)

Which of the following statements about manipulating objects in a map is NOT correct?

(Multiple Choice)
4.8/5
(46)

You need to access values using a key, and the keys must be sorted. Which collection type should you use?

(Multiple Choice)
4.9/5
(48)

Assume that you have declared a map named myMap to hold String elements with Integer keys. Which of the following statements will correctly retrieve the value of an element from myMap by using its key?

(Multiple Choice)
5.0/5
(37)

Which of the following algorithms would be efficiently executed using a LinkedList?

(Multiple Choice)
4.9/5
(37)

Consider the following code snippet: Map<String, Integer> scores; If you need to visit the keys in sorted order, which of the following statements will create a structure to support this?

(Multiple Choice)
4.9/5
(36)

When using a list iterator, on which condition will the IllegalStateException be thrown?

(Multiple Choice)
4.9/5
(30)

In a linked list data structure, when does the reference to the first node need to be updated? I inserting into an empty list II deleting from a list with one node III deleting an inner node

(Multiple Choice)
4.9/5
(32)

A stack is a collection that ____.

(Multiple Choice)
4.8/5
(38)

Which of the following statements about data structures is correct?

(Multiple Choice)
4.9/5
(33)

A linked list ____ encapsulates a position anywhere inside the linked list.

(Multiple Choice)
4.8/5
(33)

A queue is a collection that ____.

(Multiple Choice)
4.8/5
(33)

Print jobs submitted to a printer would probably be stored in which type of data structure?

(Multiple Choice)
4.7/5
(41)

You need to write a program to build and maintain an address book. Since the program must support the possibility of having duplicate names, which data structure would be most appropriate to model this situation?

(Multiple Choice)
4.8/5
(41)

You need to write a program to manage a waiting list of patrons at a restaurant. Which data structure would be most appropriate to model this situation?

(Multiple Choice)
4.8/5
(39)

Which of the following statements about a priority queue structure is NOT correct?

(Multiple Choice)
4.9/5
(31)
Showing 41 - 60 of 110
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)