


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Daa worksheet experiment 4 for chandigarh university full document with answer
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!
i. We create a boolean subset[][] and fill it in bottom up manner. ii. The value of subset[i][j] will be true if there is a subset of set[0..j-1] with sum equal to i., otherwise false. iii. subset[i][j] = true if there is a subset with: iv. the i-th element as the last element * sum equal to j v. subset[i][0] = true as sum of {} = 0 vi. subset[0][j] = false as with no elements we can get no sum vii. subset[i][j] = subset[i-1][j-E1]; where E1 = array[i-1] viii. Finally, we return subset[n][sum].
#include
Learning Outcomes:-