Exam 16: Basic Data Structures
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Consider the following code snippet, which computes h, the array index for storing x in a hash table.
Int h = x.hashCode();
If (h < 0) { h = -h; }
H = h % size;
What does size correspond to?
(Multiple Choice)
4.8/5
(35)
Complete the following code snippet, which is intended to compress a hash code to become a valid array index:
Int h = x.hashCode();
If (h < 0) { h = -h; }
_______________
(Multiple Choice)
4.9/5
(40)
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.9/5
(45)
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.7/5
(40)
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.8/5
(34)
Linked list operations that were studied included adding/removing an element at the end or in the middle, and retrieving the kth element. If the iterator is currently pointing to the correct location for insertion or removal, which of the following statements about these doubly-linked list operations is correct?
(Multiple Choice)
4.8/5
(45)
When considering the reallocation operation for a list whose buffer is full, on average it will take ____ time.
(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 the linked list is correct?
(Multiple Choice)
4.8/5
(31)
The ___ technique for handling collisions in a hash table with open addressing attempts to place colliding elements at the next available location in the hash table.
(Multiple Choice)
4.8/5
(40)
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
(41)
If we want a create a doubly-linked list data structure so that we can move from a node to the next node as well as to a previous node we need to add a previous reference to the Node class. Each such DNode (doubly-linked Node) will have a data portion and two DNode references, next and previous. How many references need to be updated when we remove a node from the beginning of a list with many nodes? Consider the first reference and neighboring node(s).
(Multiple Choice)
4.8/5
(35)
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.8/5
(32)
What is included in a linked list node?
I a reference to the next node
II an array reference
III a data element
(Multiple Choice)
4.8/5
(38)
Insert the missing code in the following code fragment. This fragment is intended to remove a node from the head of a linked list: public class LinkedList
{
) . .
Public Object removeFirst()
{
If (first == null) { throw new NoSuchElementException(); }
Object element = first.data;
________________
________________
}
) . .
}
(Multiple Choice)
4.9/5
(39)
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
(35)
Assume that you have a hash table in which there are an average number of collisions. What is the time required to remove an element from this hash table?
(Multiple Choice)
4.7/5
(34)
An array list maintains a reference to an array of elements called a ____.
(Multiple Choice)
4.7/5
(35)
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
(33)
Showing 41 - 60 of 104
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)