100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CS6515 - ALGORITHMS- EXAM 1 QUESTIONS AND ANSWERS 2024 $16.49   Add to cart

Exam (elaborations)

CS6515 - ALGORITHMS- EXAM 1 QUESTIONS AND ANSWERS 2024

 6 views  0 purchase
  • Course
  • CS6515 - ALGORITHMS
  • Institution
  • CS6515 - ALGORITHMS

CS6515 - ALGORITHMS- EXAM 1 QUESTIONS AND ANSWERS 2024

Preview 3 out of 20  pages

  • August 18, 2024
  • 20
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CS6515 - ALGORITHMS
  • CS6515 - ALGORITHMS
avatar-seller
Teacher101
CS6515 - ALGORITHMS- EXAM 1

Steps to solve a Dynamic Programming Problem - ANSWERS-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) - ANSWERS-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 - ANSWERS-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 - ANSWERS-Given d = common difference and a = first term
in series => a + (a + d) + (a + 2d) + ... + (a + (n-1)d



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



DC: Solving Recurrences - Master Theorem - ANSWERS-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 - ANSWERS-(1, 2*PI*j/n) for j = 0, 1, ..., n-1

*Around the Unit Circle!



Steps to solve for FFT - ANSWERS-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^(2*PI*i)/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 - ANSWERS-e^ix = cosx + isinx



Imaginary Number Multiples - ANSWERS-i = i, i^2 = -1, i^3 = -i, i^4 = 1

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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Teacher101. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $16.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75632 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$16.49
  • (0)
  Add to cart