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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A problem has 4 solutions:

A
  1. Universal Solution (right and wrong)
  2. Feasible Solution
    all possible correct solutions, but different levels of truth
  3. Objective function (better)
  4. Optimal Solution
    the most correct (best) solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Popular techniques in problem solving?

A
  1. greedy method
  2. dynamic programming
  3. data compression
  4. backtracking
  5. branch and bound
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Variation of Knapsack problem?

A
  1. fractional knapsack problem
    - items should be brought in part (in fractional units)
    - tergantung pada kuantitas ketersediaan barang
    - can be solved by greedy method
    - OPTIMAL
  2. 0/1 knapsack problem
    - each item is only 1 or 0
    - can NOT be solved by greedy method
  3. bounded knapsack problem
    - each item is available in N units
  4. unbounded knapsack problem
    - each item is available in more than one unit, the number is unlimited.
    - can be solved by greedy method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

2 knapsack problem yang sering muncul?

A
  1. unbounded knapsack problem (item dengan berat fix, tidak dapat dipecah)
  2. fractional knapsack problem (item dengan berat dapat dipecah)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly