• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 16 páginas
Examen

Cs6515 Algorithms Final Test Paper One 2026 Detailed Questions Graded A+

Document preview thumbnail
Vista previa 3 fuera de 16 páginas

CS6515 ALGORITHMS FINAL TEST PAPER ONE 2026 DETAILED QUESTIONS GRADED A+

Vista previa del contenido

CS6515 EXAM 2 FINAL PAPER 2026
QUESTIONS WITH ANSWERS GRADED A+

⩥ 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


⩥ 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


⩥ 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.


⩥ when to allocate a new table for the cloud. Answer: We would allocate
a new table once the load factor becomes greater than L.

,⩥ size of the table when it runs out of space in cloud. Answer: double
the size


⩥ 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)


⩥ 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


⩥ hashcodes for 32 bit integers. Answer: use unchanged


⩥ 32 bit floating point. Answer: use underlying bits as integer
(floatToIntBits())

, ⩥ 64 bit long. Answer: hashcode = [value XOR (value / 2^32) ] mod
2^32


if we want uniformity use multiplicative hashing w m = 2^32


⩥ hashcodes for types with limited # of values. Answer: booleans,
enums


cannot hope to cover entire space of hashcodes. so either map to small
ints (true = 0 and false = 1) rely on index calc scramble


OR
guess a mapping with nice properties. true = 1231 and false = 1237 bc
these #s are prime #s, not small and not next to each other


⩥ hash composite objects. Answer: either sets or sequences


⩥ sets. Answer: collection of objects that have no order [Java Set]


{3,2,5} = {2,5,3} = {5,3,2}


{} these denote sets

Información del documento

Subido en
20 de mayo de 2026
Número de páginas
16
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$10.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Vendido
37
Seguidores
2
Artículos
14285
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes