Exam 15: The Java Collections Framework

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

Select an appropriate expression to complete the method below, which is designed to print the element at the bottom of a Stack collection.The contents of the original stack are restored before the method terminates.It is safe to assume that the original stack contains at least one element. Select an appropriate expression to complete the method below, which is designed to print the element at the bottom of a Stack collection.The contents of the original stack are restored before the method terminates.It is safe to assume that the original stack contains at least one element.

(Multiple Choice)
4.8/5
(47)

Assume you have created a linked list named myList that currently holds some number of String objects.Which of the following statements correctly removes an element from the end of myList?

(Multiple Choice)
4.9/5
(33)

Select an appropriate declaration to complete the following code segment, which is designed to read strings from standard input and display them in increasing alphabetical order, excluding any duplicates. Select an appropriate declaration to complete the following code segment, which is designed to read strings from standard input and display them in increasing alphabetical order, excluding any duplicates.

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
5.0/5
(35)

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

(Multiple Choice)
4.8/5
(40)

Suppose we create a deque (double-ended queue) data structure.It is basically a queue, with its addLast and removeFirst operations, but we also add the addFirst and removeLast operations.Which of the following is best modeled by the deque data structure?

(Multiple Choice)
4.8/5
(44)

Which of the following algorithms would be efficiently executed on an ArrayList?

(Multiple Choice)
4.8/5
(33)

What type of access does a LinkedList provide for its elements?

(Multiple Choice)
4.8/5
(47)

The term ____ is used in computer science to describe an access pattern in which the elements are accessed in arbitrary order.

(Multiple Choice)
4.9/5
(42)

Which data structure would best be used for keeping track of groceries to be purchased at the food market?

(Multiple Choice)
4.9/5
(40)

Assume that you have declared a stack named myStack to hold String elements.Which of the following statements will correctly retrieve the top element from myStack without removing it?

(Multiple Choice)
4.8/5
(37)

What operation is least efficient in a LinkedList?

(Multiple Choice)
4.9/5
(41)

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

(Multiple Choice)
4.9/5
(43)

Which of the following statements about manipulating objects in a set 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
(42)

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

(Multiple Choice)
4.9/5
(45)

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

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)
5.0/5
(29)

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

(Multiple Choice)
4.8/5
(34)

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.9/5
(40)
Showing 41 - 60 of 102
close modal

Filters

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