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

CS6515 - Algorithms Questions with Verified Correct Answers

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

CS6515 - Algorithms Questions with Verified Correct Answers

Vista previa del contenido

CS6515 - Algorithms Questions with Verified
Correct Answers
Steps to solve a Dynamic Programming Problem

1. Define the Input and Output.



2. Define entries in table, i.e. T(i) or T(i, j) is...



3. Define a Recurrence relationship - Based on a subproblem to the main problem. (hint: use

a prefix of the original input 1 < i < n).



4. Define the Pseudocode.



5. Define the Runtime of the algorithm. Use Time Function notation here => T(n) = T(n/2) +

1...

DP: Types of Subproblems (4)

Input = x1, x2, ..., xn

1) Subproblem = x1, x2, ..., xi ; O(n)

2) Subproblem = xi, xi+1, ..., xj ; O(n^2)



Input = x1, x2, ..., xn; y1, y2, ..., ym

1) Subproblem = x1, x2, ..., xi; y1, y2, ..., yj ; O(mn)



Input = Rooted Binary Tree

1) Subproblem = Smaller rooted binary tree inside the Input.

,DC: Geometric Series

Given r = common ratio and a = first term in series

=> a + ar + ar^2 + ar^3 + ... + ar^(n-1)



=> a * [(1 - r^n) / (1-r)]

DC: Arithmetic Series

Given d = common difference and a = first term in series => a + (a + d) + (a + 2d) + ... + (a +

(n-1)d



Sum = n/2 [2a + (n-1)d]

DC: Solving Recurrences - Master Theorem

If T(n) = aT([n/b]) + O(n^d) for constants a>0, b>1, d>=0:



T(n) = {

O(n^d) if d > logb(a)

O((n^d)logn) if d = logb(a)

O(n^(logb(a))) if d < logb(a)

}

Nth roots of Unity

(1, 2PIj/n) for j = 0, 1, ..., n-1

*Around the Unit Circle!

Steps to solve for FFT

, 1) Write out Matrix Coefficient Form based on n (size of input) Mn(w) = [ 1 1 ... 1

1 w ... w^n-1

...

1 w^n-1 ... w^((n-1)*(n-1)) ]



2) Find value for w = e^(2PIi)/n, Substitute in Mn(w).



3) For the input coefficients into nx1 matrix. I.E. [4 0 1 1], let known as B.



4) Evaluate FFT:

a) FFT of Input = Mn(w) x B

b) Inverse FFT of Input = 1/n * Mn(w^-1) x B

Euler's Formula

e^ix = cosx + isinx

Imaginary Number Multiples

i = i, i^2 = -1, i^3 = -i, i^4 = 1

i = -i, i^2 = -1, i^3 = i, i^4 = 1

Omega(w)

w = (1, 2PI / n) = e^(2PI*i/n)

DC Algorithms and Runtimes (6)

MergeSort: O(nlogn) - Split the input array into two halves and recursively sort and merge at

the end.

Información del documento

Subido en
12 de octubre de 2026
Número de páginas
18
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
KenAli
2.6
(18)
Vendido
120
Seguidores
5
Artículos
25837
Ú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