Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 1 \"Given a table size of 13 the hash function h(k) = k % table size, w

ID: 3687080 • Letter: Q

Question

QUESTION 1
"Given a table size of 13 the hash function h(k) = k % table size, what index does the entry 26 map to?"

   a)   13

   b)   26

   c)   12

   d)   0
QUESTION 2
Hashing is a good technique for implementing a dictionary when _____ is the primary task.

   a)   sorting

   b)   adding entries

   c)   searching

   d)   removing entries
QUESTION 3
The average number of comparisons for an unsuccessful search when hashing with separate chaining is

   a)   1 + ? / 2

   b)   n / ?

   c)   ?

   d)   n

QUESTION 4
"Given a table size of 19 the hash function h(k) = k % table size, what index does the entry 24 map to?"

   a)   4

   b)   19

   c)   24

   d)   5
QUESTION 5
The successful addition of a new entry in a dictionary occurs

   a)   after a search for a given key fails

   b)   after a search for a given key succeeds

   c)   after linear probing

   d)   after quadratic probing
QUESTION 6
"In hashing with open addressing, an empty location is represented by"

   a)   0

   b)   an empty flag

   c)   null

   d)   none of the above
QUESTION 7
"If you use quadratic probing for collision resolution, it is recommended that the hash table be"

   a)   less than half full

   b)   more than half full

   c)   almost empty

   d)   extended to use buckets
QUESTION 8
The cost of a successful search for an entry is _____ the cost of inserting that entry.

   a)   more than

   b)   less than

   c)   the same as

   d)   unrelated to

Question 9

  
   "In the unsorted array-based dictionary class ArrayDictionary, what does the add method return if the search key is found?"          
  
a)   Null
b)   The number of entries
c)   The corresponding value it found
d)   It throw and exception          
Question 10

  
   "In the unsorted array-based dictionary class ArrayDictionary, what does the remove method return if the search key is found in the dictionary?"          
a)   The Search key
b)   True
c)   Null
d)   The corresponding value
Question 11
In the unsorted array-based dictionary class ArrayDictionary, what does the add method return if the search key is not found?"

a)   Null
b)   The number of entries
c)   0
d)   True
Question 12
In an array-based implementation of a dictionary, if you represent the entries as an array of objects that encapsulate each search key and corresponding value, how many pointers will you use per array entry?"
a)   3
b)   4
c)   2
d)   1
Question 13
"In a linked implementation of a dictionary, if you represent the entries as a chain of nodes that each reference an entry object, how many pointers will you use per entry?"
a)   3
b)   2
c)   4
d)   1
Question 14
"In the unsorted array-based dictionary class ArrayDictionary, what does the locateIndex method return if the search key is not found?"
a)   Null
b)   The number of entries
c)   0
d)   It throw an exception
Question 15
In a linked implementation of a dictionary, if you represent the entries as parallel chains of search keys and corresponding values, how many pointers will you use per entry?"
a)   3
b)   2
c)   1
d)   4
Question 16
"In a linked implementation of a dictionary, if you represent the entries as a chain of nodes that each reference a search key and a value, how many pointers will you use per entry?"
a)   4
b)   3
c)   1
d)   2

Question 17
Shell sort works by

a)   iteratively searching for the smallest entry in subarrays of equally spaced entries
b)   iteratively searching for the smallest entry in subarrays of equal size consecutive entries
c)   using insertion sort of subarray of equal size consecutive entries
d)   using insertion sort on subarray of equal spaced entries
Question 18
What is the base case in the recursive selection sort method?

a)   there is no base case
b)   the array is empty
c)   the array is found to sorted
d)   the array has only on element
Question 19
Shell sort can be improved by

a)   using selection sort instead of insertion sort as the final step
b)   alternating insertion sort and selection sort each iteration
c)   you cannot improve the algorithms time efficiency
d)   adding 1 to the space when it is even

Explanation / Answer

1.d

2.C

3.D

4.D

5.D

6.B

7.A

8.A

9.C

10.A

11.A

12.D

13.D

14.A

15.C

16.C

17.B

18.C

19.B

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote