Exam 16: Basic Data Structures

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

Adding or removing an element at an arbitrary iterator position in a singly linked list of length n takes ____ time.

(Multiple Choice)
4.7/5
(41)

Suppose we maintain a linked list of length n in sorted order. What would be the big-Oh notation for printing out those elements that occur exactly once in the list?

(Multiple Choice)
4.9/5
(43)

Using the textbook's implementation of a linked list, what is the purpose of declaring the Node class to be a static inner class?

(Multiple Choice)
4.8/5
(40)

Array list operations that were studied included adding/removing an element at the end or in the middle, and retrieving the kth element. Which of the following statements about these array list operations is correct?

(Multiple Choice)
4.9/5
(32)

Which of the following actions must be taken to remove a node X from the middle of a doubly-linked list? I Update the next reference in the node before X II Update the previous reference in the node after X III Update the list's first reference

(Multiple Choice)
4.9/5
(39)

If your hashCode function returns a number anywhere in the hash table with equal probability, what is the likely result?

(Multiple Choice)
4.9/5
(32)

Which of the following statements about adding an element to a hash table is NOT correct?

(Multiple Choice)
4.8/5
(38)

Why is it not typical to use the hashCode method result directly as an index for array storage? I because the hashcode method returns a double II the values are potentially very large III the values are not type int

(Multiple Choice)
4.8/5
(35)

Suppose we maintain a linked list of length n in random element order. What would be the big-Oh notation for printing out those elements which occur exactly once in the list (without sorting the list)?

(Multiple Choice)
4.8/5
(34)

You have implemented a queue as a singly-linked list, adding elements at the end and removing elements at the front. What is the cost of the remove operation?

(Multiple Choice)
4.7/5
(42)

When considering the reallocation operation for a list whose buffer is full, on average it will take ____ time.

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(43)

On average, how many elements of an array list of size n need to be moved when an element is removed?

(Multiple Choice)
4.9/5
(37)

When using the textbook's implementation of a singly linked list to remove an element in the middle of the list, why it is necessary to check whether the previous reference equals the position reference?

(Multiple Choice)
4.9/5
(39)

What type of access does the use of an iterator with a LinkedList provide for its elements?

(Multiple Choice)
4.7/5
(37)

On average, how many elements of an array list of size n need to be moved when an element is added?

(Multiple Choice)
4.8/5
(45)

Which of the following statements about removing a node from a linked list is correct?

(Multiple Choice)
4.7/5
(39)

Assume that you have a hash table in which there are an average number of collisions. What is the time required to add an element to this hash table?

(Multiple Choice)
4.9/5
(38)

Assume that the linked list implementation includes a reference to the last node as well as to the first node. Which of the following statements about the efficiency of a singly linked list is NOT correct?

(Multiple Choice)
4.9/5
(39)

In the textbook implementation, the Node class is a private inner class of the LinkedList class. Which of the following statements regarding this implementation is NOT correct?

(Multiple Choice)
4.8/5
(36)
Showing 41 - 60 of 94
close modal

Filters

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