• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

Cs 6515 Exam 2 Review Sheet Complete Questions Answers Graded A Plus.pdf

Document preview thumbnail
Preview 2 out of 12 pages

CS 6515 EXAM 2 REVIEW SHEET COMPLETE QUESTIONS ANSWERS GRADED A PLUS.pdf

Content preview

CS 6515 EXAM 2 REVIEW SHEET COMPLETE QUESTIONS ANSWERS GRADED A PLUS




Question:
average case for a string table.

Answer:
The average case is Theta 1 because the running time for the average case is dependent on the load
factor, which in this case is assumed to be constant



Question:
code for adding the string table into the cloud.

Answer:
do one for loop going thru the indexes of the array, then for each loop going thru each record in b[i].
then call insert for other record but use the new number of buckets for to index



Question:
run time to get everything from a table into a cloud.

Answer:
The running time would be Theta n because under the assumption of simple uniform hashing, the
elements are evenly distributed so there would be an even distribution among each list. This means
the length of the lists are insignificant in comparison to the total number of elements, so the find
method would take constant time (and therefore insert and remove are also constant because they
use find). But, we call the insert n times for the n number of elements to be inserted into the table, so
the running time would be n.



Question:
when to allocate a new table for the cloud.

Answer:

, We would allocate a new table once the load factor becomes greater than L.



Question:
size of the table when it runs out of space in cloud.

Answer:
double the size



Question:
purpose of hashcode generation.

Answer:
-map integers in some range object that are equal() must have the same hashcode objects that are
notEqual() should have distinct hashcodes (but this might not be possible bc of pigeonhole
principle)



Question:
should hash codes be spread uniformly across range w/o obvious correlations?

Answer:
2 arguments: no 2nd step (index generation) is responsible for ensuring unequal hash codes mapped
to uniform uncorrelated indices yes index generator is not responsible for fixing bad hashcode
generator. even if index generator scrambles hashcode, if universe is much greater than # of possible
hashcodes, there is a greater likelihood that the objects map to the same hashcode. gonna have
collisions so bucket might not help



Question:
hashcodes for 32 bit integers.

Answer:
use unchanged

Document information

Uploaded on
August 12, 2026
Number of pages
12
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
2
Followers
0
Items
6341
Last sold
5 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions