Answer:
See attachment for flowchart
Explanation:
Required
Flowchart to fine even from 1 to 50
The flowchart has been attached.
The rough algorithm (explanation) of the flowchart is as follows.
1. Start
2. Initialize num to 1
3. Check if num is less than or equal to 50
3.1 If yes
3.1.1 Check if num is even
3.1.1.1 If yes
3.1.1.2 Print num
3.1.3 Increase num by 1
3.2 If num is greater than 50
3.2.1 Stop
4. Goto 3
Answer:
"Option 1: To the end of an array." is the correct answer.
Explanation:
The word "Append" means adding to the end of a document.
Appending means whatever new content is added, it is added at the end of the document or data structure.
Similarly,
Appending an array means adding new elements to the end of the array.
Hence,
"Option 1: To the end of an array." is the correct answer.
Answer: True
Explanation:
Subset sum problem and Knapsack problem can be solved using dynamic programming.
In case of Knapsack problem there is a set of weights associative with objects and a set of profits associated with each object and a total capacity of knapsack let say C. With the help of dynamic programming we try to include object's weight such that total profit is maximized without fragmenting any weight of objects and without exceeding the capacity of knapsack, it is also called as 0/1 knapsack problem.
Similar to knapsack problem, in subset sum problem there is set of items and a set of weights associated with the items and a capacity let say C, task is to choose the subset of items such that total sum of weights associated with items of subset is maximized without exceeding the total capacity.
On the basis of above statements we can say that subset sum problem is generalization of knapsack problem.