• ¿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 19 páginas
Examen

Cs 6515 Exam 1 Essential Computer Science Concepts Review

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

Cs 6515 Exam 1 Essential Computer Science Concepts Review

Vista previa del contenido

CS 6515 EXAM 1 ESSENTIAL COMPUTER
SCIENCE CONCEPTS REVIEW

◉ knapsack with repetition.
Answer: knapsack repeat(w_i....w_n, w_i... w_n, B)
k(0) = 0
for i = 1 to n
if w_i <= b & k(b) <v_i + K(b-w_i)
then k(b) = v_i + K(b-w_i)


◉ Longest Increasing Subsequence.
Answer: LIS(a_1.... a_n)
for i = 1 to n
L(i) = 1
for j = 1 to n -1
if a_j < a_i & L(i) < 1 + L(j)
L(i) = 1 + L(j)
max = 1
for i = 2 to n
if L(i) > L(max) then max = i
return(L(max))

,◉ longest common subsequence algo.
Answer: LCS(X,Y)
for i = 0 to n: L(i, 0) = 0
for j = 0 to n: L(0,j) = 0
for i = 1 to n
for j = 1 to n
if X_i == Y_j:
L(i,j) = L(i - 1, j - 1) + 1
else:
L(i,j) = max(L(i - 1, j),L(i,j-1)
return(L(i,j)


◉ longest common substring.
Answer:


◉ what is Big oh of LCS?.
Answer: O(n**2)


◉ what is big Oh of longest common substring?.
Answer: O(mn)

, ◉ what is important to remember when calculating longest common
subsequence as opposed to substring?.
Answer: substring is very diagonal and plus 1
subsequence you have to use a max function


◉ Perform longest common substring and subsequence on:
"abcdaf"
"3bcdf"
What are the recurrences? write down the algorithm and results.
Answer:


◉ if you are presented with a coins (1,5,6,8) and your knapsack is k
= 11, what is the minimum number of coins, what would be the
computational time, and what is the recurrence?.
Answer: https://www.youtube.com/watch?v=Y0ZqKpToTic


◉ how to calculate longest increasing substring. Try it using the
following:
541208563.
Answer: It should only require two separate loops:
one to loop to go through to calculate the values
- then a separate loop to figure out what the max is... and then return
the max

Información del documento

Subido en
26 de octubre de 2026
Número de páginas
19
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$17.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.
TopGradeInsider
4.1
(14)
Vendido
205
Seguidores
1
Artículos
66808
Última venta
4 horas 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