Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CS6515 - Exam 1 Complete Questions And Answers

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
30-01-2025
Written in
2024/2025

CS6515 - Exam 1 Complete Questions And Answers What are the dimensions of the array for solving the knapsack problem WITHOUT repetition? - ANSWER -2-D array What is the recurrence for knapsack w/o repetition? - ANSWER -K(i,b) = max((vi + K(i-1,biwi)),K(i-1,b) if wi b) K(i,b) = K(i-1,b) otherwise What are the base cases for knapsack w/o repetion? - ANSWER -K(0,b) = 0 & K(i,0) = 0 which is when we have no objects and no knapsack, respectively What is the running time of the knapsack w/o repetition algorithm? - ANSWER -It is pseudopolynomial O(nB) What are the dimensions of the array for solving the knapsack problem WITH repetition? - ANSWER -1-D array What is the recurrence for knapsack w/ repetition? - ANSWER -K(b) = max(vi + K(b-wi)) for all items i with a weight less than or equal to current capacity b What is the running time of the knapsack w/ repetition? - ANSWER -O(Bn) What is the time complexity for multiplying two matrices A (dimensions n x m) and B (dimensions m x k) - ANSWER -O(nmk) If we have n matrices, A1, A2... An how can we define each of their sizes? - ANSWER -mi-1 x mi since the inner dimensions of a matrix product must match Whats the most likely base algorithm to use if problem only has a single array? - ANSWER - LIS What is the most likely algorithm if problem is comparing to iself - ANSWER -LIS What is the most likely alg if problem only looks back one elemnt at a time (not a window, or a bag) - ANSWER -LIS What are the two most common LIS variations? - ANSWER -O(n) lookback O(1) lookback What is most likely alg if problem is comparing between two arrays? - ANSWER -LCS What is most likely alg if problem is looking for something in common? - ANSWER -LCS Describe the process for LCS (substring variation) - ANSWER -Add 1 to L(i-1,j-1) and set to 0 otherwise. Solution is max(L) Describe the process for LCS (subsequence variation) - ANSWER -If ending characters are same: L(i-1,j-1) + 1 If ending characters are different: max{ L(i-1,j), L(i,j-1) } Solution is L(n,m) or L(n,n) What is most likely alg if problem is looking to minimize differences? - ANSWER -Edit Distance What is the most likely alg if the problem assigns some penalty to differences? - ANSWER - Edit Distance What is the most likely alg if problem assigns some points to matches? - ANSWER -Edit Distance What is the most likely alg if you are aligning two arrays? - ANSWER -Edit Distance What is the traditional size of subproblem table for an edit distance problem? - ANSWER -2-D What is the most likely alg if your problem needs to check if something can fit or can add up to - ANSWER -Knapsack What is the most likely alg if your problem needs a max value for a specific budget - ANSWER -Knapsack What is the most likely alg if your problem needs to find the min budget needed for a specific value - ANSWER -Knapsack What are the two variations of knapsack? - ANSWER -1. With repeat of items 2. Without repeat of items What algorithm is used to determine the shortest path from each vertex to every other vertex? - ANSWER -Floyd-Warshall What algorithm is used to determine the shortest path from a single vertex to every other vertex? - ANSWER -Bellman-Ford What logarithmic property allows you to still use a shortest path algorithm even if edge weights are supposed to be multiplied? - ANSWER -Log(ab) = Log(a) + Log(b). Therefore you can take the log of every edge weight Runtime complexity of binary search - ANSWER -O(logn) Runtime complexity of Mergesort - ANSWER -O(nlogn)

Show more Read less
Institution
CS6515 -
Course
CS6515 -

Content preview

CS6515 - Exam 1 Complete Questions And Answers
What are the dimensions of the array for solving the knapsack problem WITHOUT repetition? -
ANSWER -2-D array


What is the recurrence for knapsack w/o repetition? - ANSWER -K(i,b) = max((vi + K(i-1,bi-
wi)),K(i-1,b) if wi < b)
K(i,b) = K(i-1,b) otherwise


What are the base cases for knapsack w/o repetion? - ANSWER -K(0,b) = 0 & K(i,0) = 0 which
is when we have no objects and no knapsack, respectively


What is the running time of the knapsack w/o repetition algorithm? - ANSWER -It is
pseudopolynomial O(nB)


What are the dimensions of the array for solving the knapsack problem WITH repetition? -
ANSWER -1-D array


What is the recurrence for knapsack w/ repetition? - ANSWER -K(b) = max(vi + K(b-wi)) for
all items i with a weight less than or equal to current capacity b


What is the running time of the knapsack w/ repetition? - ANSWER -O(Bn)


What is the time complexity for multiplying two matrices A (dimensions n x m) and B
(dimensions m x k) - ANSWER -O(nmk)


If we have n matrices, A1, A2... An how can we define each of their sizes? - ANSWER -mi-1 x
mi since the inner dimensions of a matrix product must match


Whats the most likely base algorithm to use if problem only has a single array? - ANSWER -
LIS

, What is the most likely algorithm if problem is comparing to iself - ANSWER -LIS


What is the most likely alg if problem only looks back one elemnt at a time (not a window, or a
bag) - ANSWER -LIS


What are the two most common LIS variations? - ANSWER -O(n) lookback
O(1) lookback


What is most likely alg if problem is comparing between two arrays? - ANSWER -LCS


What is most likely alg if problem is looking for something in common? - ANSWER -LCS


Describe the process for LCS (substring variation) - ANSWER -Add 1 to L(i-1,j-1) and set to 0
otherwise. Solution is max(L)


Describe the process for LCS (subsequence variation) - ANSWER -If ending characters are
same: L(i-1,j-1) + 1
If ending characters are different:
max{ L(i-1,j), L(i,j-1) }


Solution is L(n,m) or L(n,n)


What is most likely alg if problem is looking to minimize differences? - ANSWER -Edit
Distance


What is the most likely alg if the problem assigns some penalty to differences? - ANSWER -
Edit Distance


What is the most likely alg if problem assigns some points to matches? - ANSWER -Edit
Distance

Written for

Institution
CS6515 -
Course
CS6515 -

Document information

Uploaded on
January 30, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$8.49
Get access to the full document:

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


Also available in package deal

Thumbnail
Package deal
CS6515 EXAM BUNDLE | Questions And Answers| Latest 20252026
-
4 2025
$ 24.25 More info

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TheExamMaestro Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
149
Member since
2 year
Number of followers
5
Documents
3564
Last sold
6 days ago
STA

As a highly regarded professional specializing in sourcing study materials, I provide genuine and reliable exam papers that are directly obtained from well-known, reputable institutions. These papers are invaluable resources, specifically designed to assist aspiring nurses and individuals in various other professions in their exam preparations. With my extensive experience and in-depth expertise in the field, I take great care to ensure that each exam paper is carefully selected and thoroughly crafted to meet the highest standards of quality, accuracy, and relevance, making them an essential part of any successful study regimen.

Read more Read less
3.6

18 reviews

5
9
4
2
3
2
2
0
1
5

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