Tugas
Tugas
Tugas
NIM : 2602168772
Jurusan : Mobile Application & Technology
SOAL
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1
1. Conversion Infix to Postfix (using stack)
2. Conversion Infix to Prefix (using stack)
3. Evaluation Postfix (using stack)
4. Evaluation Prefix (using stack)
1.
2.
3.
4.
Infix String Stack
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 *
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 *
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -{
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(*
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(*
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(+
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(+
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(+-
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(-
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -(-
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -*
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -*
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -/
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -/
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 -+
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 +
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1 +
9 * 8 - (7 * 6 + 5 - 4) * 3 / 2 + 1
HASIL = 8,5