Exam 15: The Java Collections Framework

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

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

Free
(Multiple Choice)
4.9/5
(29)
Correct Answer:
Verified

A

You use a(n) ____ to access elements inside a linked list.

Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
Verified

C

What is included in a linked list node? i.a reference to its neighboring nodes II.an array reference III.a data element

Free
(Multiple Choice)
4.8/5
(44)
Correct Answer:
Verified

B

Rather than storing values in an array, a linked list uses a sequence of ____.

(Multiple Choice)
4.9/5
(32)

Assume you are using a doubly-linked list data structure with many nodes.What is the minimum number of node references that are required to be modified to remove a node from the middle of the list? Consider the neighboring nodes.

(Multiple Choice)
4.8/5
(49)

Assume that you have declared a map named myMap to hold String values with Integer keys.Which of the following statements will correctly retrieve the value associated with a key from myMap?

(Multiple Choice)
4.7/5
(36)

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". 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.

(Multiple Choice)
4.8/5
(31)

Select an appropriate expression to complete the following method, which is designed to return the number of elements in the parameter array numbers.If a value appears more than once, it should be counted exactly once. Select an appropriate expression to complete the following method, which is designed to return the number of elements in the parameter array numbers.If a value appears more than once, it should be counted exactly once.

(Multiple Choice)
4.8/5
(33)

Complete the following code, which is intended to print out all key/value pairs in a map named myMap that contains String data for student IDs and names: Complete the following code, which is intended to print out all key/value pairs in a map named myMap that contains String data for student IDs and names:

(Multiple Choice)
4.8/5
(36)

A queue is a collection that ____.

(Multiple Choice)
4.8/5
(41)

The nodes of a(n) ____ linked list class store two links: one to the next element and one to the previous one.

(Multiple Choice)
4.9/5
(32)

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

(Multiple Choice)
5.0/5
(33)

Which nodes need to be updated when we insert a new node to become the fourth node from the beginning of a doubly-linked list?

(Multiple Choice)
4.9/5
(44)

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

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

Which of the following statements about hash functions is NOT correct?

(Multiple Choice)
4.9/5
(36)

You intend to use a hash set with your own object class.Which of the following statements is correct?

(Multiple Choice)
4.7/5
(31)

Which Java package contains the LinkedList class?

(Multiple Choice)
4.8/5
(22)

You need a data structure in your program for finding a path out of a maze using backtracking.Which data structure would be most appropriate to model this situation?

(Multiple Choice)
4.9/5
(37)

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

(Multiple Choice)
4.8/5
(37)
Showing 1 - 20 of 102
close modal

Filters

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