Exam 16: Basic Data Structures

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

Complete the following code, which is intended to add an element to a hash table. Assume that the computed and compressed hash code is stored in the variable h. Node newNode = new Node(); NewNode.data = x; _________________ _________________

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

D

What is the time required to iterate over all elements in a hash table of size n?

Free
(Multiple Choice)
4.7/5
(33)
Correct Answer:
Verified

B

Using the textbook's implementation of a linked list, which of the following statements about adding a node to the middle of a linked list is correct?

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

B

A stack can be implemented as a sequence of nodes in a linked list or an array list. Which of the following statements about this is correct?

(Multiple Choice)
4.8/5
(44)

Suppose we maintain two linked lists of length n in sorted order. What would be the big-Oh notation for the creating a third list, which included only elements common to both lists?

(Multiple Choice)
4.9/5
(37)

Array lists and linked lists both have the same ____.

(Multiple Choice)
4.8/5
(39)

What is never present in a static inner class?

(Multiple Choice)
4.9/5
(38)

When implementing a queue as a singly-linked list, which of these statements is correct?

(Multiple Choice)
4.8/5
(39)

The linked list iterator described in the textbook maintains a reference to the last visited node, called position, and a reference to the last node before that, called previous. Which of the following statements is NOT correct regarding advancing this iterator?

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.9/5
(37)

Which of the following statements about a linked list and its iterator is NOT correct?

(Multiple Choice)
4.7/5
(42)

A hash function is considered good if it ____.

(Multiple Choice)
4.9/5
(32)

In the separate chaining technique for handling collisions in a hash table, ____.

(Multiple Choice)
4.8/5
(45)

Which of the following statements about handling collisions in a hash table using the sequential chaining and open addressing techniques is NOT correct?

(Multiple Choice)
4.7/5
(34)

The advantage of using the open addressing technique over the separate chaining technique for handling collisions in a hash table is that open addressing ____.

(Multiple Choice)
4.9/5
(41)

Complete the following code snippet, which is intended to compress a hash code to become a valid array index: _____________________ If (h < 0) { h = -h; } Position = h % arrayLength;

(Multiple Choice)
4.8/5
(40)

Which of the following actions must be taken to add a node X into the middle of a doubly-linked list? I Update the next reference in the node before the position where X will be placed II Update the previous reference in the node after the position where X will be placed III Update the list's first reference

(Multiple Choice)
4.9/5
(36)

Which Java package contains the LinkedList class?

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.8/5
(38)

When the buffer for an array list must be grown, a single reallocation operation takes ____ time.

(Multiple Choice)
4.8/5
(42)
Showing 1 - 20 of 94
close modal

Filters

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