Week 3 Flashcards
1
Q
4 jenis traversal?
A
– Pre-order Traversal
• parent–left–right
– Level-order Traversal
• parent–left–right(eachlevel)
– In-order Traversal
• left–parent–right
– Post-order Traversal
• left–right–parent
2
Q
A problem has 4 solutions:
A
- Universal Solution (right and wrong)
- Feasible Solution
all possible correct solutions, but different levels of truth - Objective function (better)
- Optimal Solution
the most correct (best) solution
3
Q
Popular techniques in problem solving?
A
- greedy method
- dynamic programming
- data compression
- backtracking
- branch and bound
4
Q
Variation of Knapsack problem?
A
- fractional knapsack problem
- items should be brought in part (in fractional units)
- tergantung pada kuantitas ketersediaan barang
- can be solved by greedy method
- OPTIMAL - 0/1 knapsack problem
- each item is only 1 or 0
- can NOT be solved by greedy method - bounded knapsack problem
- each item is available in N units - unbounded knapsack problem
- each item is available in more than one unit, the number is unlimited.
- can be solved by greedy method
5
Q
2 knapsack problem yang sering muncul?
A
- unbounded knapsack problem (item dengan berat fix, tidak dapat dipecah)
- fractional knapsack problem (item dengan berat dapat dipecah)