Exam 15: The Java Collections Framework

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

A collection that allows items to be added only at one end and removed only at the other end is called a ____.

(Multiple Choice)
4.8/5
(33)

Assume that you have declared a map named myMap to hold String values with Integer keys.Which of the following statements will correctly add an association into myMap?

(Multiple Choice)
4.9/5
(43)

A binary search requires ____ access.

(Multiple Choice)
4.8/5
(33)

You need a data structure in your program for evaluating algebraic expressions.Which data structure would be most appropriate to model this situation?

(Multiple Choice)
4.7/5
(40)

Which of the following statements about sets is correct?

(Multiple Choice)
4.8/5
(42)

You need to access values in the opposite order in which they were added (last in, first out), and not randomly.Which collection type should you use?

(Multiple Choice)
4.8/5
(33)

Which method is NOT part of the ListIterator interface?

(Multiple Choice)
4.9/5
(39)

Select an appropriate expression to complete the following method, which is designed to return the sum of the two smallest values in the parameter array numbers. Select an appropriate expression to complete the following method, which is designed to return the sum of the two smallest values in the parameter array numbers.

(Multiple Choice)
4.9/5
(41)

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.7/5
(40)

Assume you have created a linked list named myList that currently holds some number of String objects.Which of the following statements correctly adds a new element to the beginning of myList?

(Multiple Choice)
4.8/5
(30)

You need a data structure in your program for balancing parentheses in an expression.Which data structure would be most appropriate to model this situation?

(Multiple Choice)
4.8/5
(38)

Consider the following code snippet: Consider the following code snippet:   What output will be produced when this code is executed? What output will be produced when this code is executed?

(Multiple Choice)
4.9/5
(34)

A linear search only requires ____ access.

(Multiple Choice)
4.9/5
(41)

Using the merge method of the Map interface, which statement correctly updates the salesTotalByDept map of type Map<String,Integer> to update the sales total for a dept by an integer sales value?

(Multiple Choice)
4.8/5
(27)

Select an appropriate expression to complete the method below.The method should return the number of times that the string stored in name appears in theList. Select an appropriate expression to complete the method below.The method should return the number of times that the string stored in name appears in theList.

(Multiple Choice)
4.7/5
(36)

Suppose we have two String objects and treat the characters in each string from beginning to end in the following way: With one string, we push each character on a stack.With the other string, we add each character to a queue.After processing both strings, we then pop one character from the stack and remove one character from the queue, and compare the pair of characters to each other.We do this until the stack and the queue are both empty.What does it mean if all the character pairs match?

(Multiple Choice)
4.8/5
(38)

When using the add method of the ListIterator to add an element to a linked list, which of the following statements is correct?

(Multiple Choice)
4.7/5
(36)

Select an appropriate expression to complete the following code segment, which is designed to print a message if the string stored in name is the first element of the players linked list. Select an appropriate expression to complete the following code segment, which is designed to print a message if the string stored in name is the first element of the players linked list.

(Multiple Choice)
4.8/5
(27)

Assume that you have declared a queue named myQueue to hold String elements.Which of the following statements will correctly insert an element into myQueue?

(Multiple Choice)
4.7/5
(29)

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

(Multiple Choice)
4.8/5
(29)
Showing 61 - 80 of 102
close modal

Filters

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