To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 2 ICP = 3 > ISP = -1 Push 1 Postfix = 2 3 + 0 Info 5 Max ( ISP -1 -1 43 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * ( 2 + 3 ) * ( 5 – 2 ) 5 4 3 ( ICP = 7 Always PUSH opener to stack) 2 1 Postfix = 2 3 + * 0 Info 5 Max ( ISP 4 0 44 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 2 Write Operand To Postfix String ( 1 Postfix = 2 3 + 5 * 0 Info 5 Max ( ISP 0 1 45 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 ICP = 1 > ISP = 0 Push 2 ( 1 * 0 Postfix = 2 3 + 5 Info 5 Max ( ISP 0 1 46 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 - 2 Write Operand To Postfix String ( 1 * 0 2 Postfix = 2 3 + 5 Info 5 Max ( ISP 1 2 47 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 - 2 Scope Closer – Pop & Add To Postfix ( 1 * 0 - Postfix = 2 3 + 5 2 Info 5 Max ( ISP 1 2 48 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 2 Done – Pop Stack & Add To Postfix 1 * 0 Postfix = 2 3 + 5 2 - * Info 5 Max ( ISP 2 0 49 Top
To Form Postfix ICP ISP • Examine one Infix character at a time – left to right + - • If Operand, Write it to the Postfix String 1 2 • If Scope Opener or Operator * / • If the In-Coming Priority (ICP) is greater than the In-Stack 3 4 Priority (ISP) Push ^ 6 5 • If ICP < ISP Pop – Write Values To Postfix Until Can Push • If Scope Closer, Pop till find opener – Write values to ({[ 7 0 Postfix – Throw out scope opener! • Empty Stack – Write Values To Postfix )}] - 2 3 + 5 2 - * 5 ( 2 + 3 ) * ( 5 – 2 ) 4 3 It is finished – Success! – Stack Is Empty! 2 1 0 Postfix = 2 3 + 5 2 - * Info 5 Max ( ISP 2 -1 50 Top
51
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 5 Postfix = 1 0 Info 5 Max ISP = -1 -1 52 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 ICP = 1 > ISP -1 PUSH ({[ 7 0 )}] - 5 4 3 2 Postfix = 5 1 0 Info 5 Max ISP = -1 -1 53 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 2 Postfix = 5 1 + 0 Info 5 Max ISP = 1 0 54 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 ICP = 6 > ISP 2 PUSH ({[ 7 0 )}] - 5 4 3 2 Postfix = 5 2 1 + 0 Info 5 Max ISP = 2 0 55 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 ({[ 7 0 Write Operand To Postfix String )}] - 5 4 3 2 Postfix = 5 2 3 ^ 1 + 0 Info 5 Max ISP = 5 1 56 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 ICP = 6 > ISP 5 Push ({[ 7 0 )}] - 5 4 3 2 Postfix = 5 2 3 ^ 1 + 0 Info 5 Max ISP = 5 1 57 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 ({[ 7 0 Write Operand To Postfix String )}] - 5 4 3 ^ 2 Postfix = 5 2 3 2 ^ 1 + 0 Info 5 Max ISP = 5 2 58 Top
5 2 3 2 ^ ^ + ICP ISP + - 1 2 Infix = 5 + 2 ^ 3 ^ 2 * / 3 4 ^ 6 5 ({[ Done – Pop Stack & Add To Postfix 7 0 )}] - 5 4 3 ^ 2 ^ ^ + Postfix = 5 2 3 2 ^ 1 + 0 Info 5 Max ISP = 5 2 59 Top
60
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 – 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 3 Postfix = 1 0 Info 5 Max ISP = -1 -1 61 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ICP = 3 > ISP = -1 Push * ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 1 0 Info 5 Max ISP = -1 -1 62 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 2 Postfix = 3 1 * 0 Info 5 Max ISP = 4 -1 63 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ICP = 1 < ISP = 4 Pop * Add To ({[ 7 0 Postfix & Try Again! Push + )}] - 5 4 3 2 * Postfix = 3 2 1 * 0 Info 5 Max ISP = 4 -1 64 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 1 + 0 Info 5 Max ISP = 2 -1 65 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ICP = 1 < ISP = 2 Pop + Add To ({[ 7 0 Postfix & Try Again! Push - )}] - 5 4 3 2 Postfix = 3 2 * 3 + 1 + 0 Info 5 Max ISP = 2 -1 66 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 1 - 0 Info 5 Max ISP = 2 -1 67 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ICP = 3 > ISP = 2 Push / ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 1 - 0 Info 5 Max ISP = 2 -1 68 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 2 / 1 - 0 Info 5 Max ISP = 2 0 69 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ICP = 3 < ISP = 4 Pop / Add To ({[ 7 0 Postfix & Try Again! Push / )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 2 / / 1 - 0 Info 5 Max ISP = 4 1 70 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 2 / / 2 1 - 0 Info 5 Max ISP = 4 1 71 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ICP = 1 < ISP = 4 Pop / Add To ({[ 7 0 Postfix & Try Again! Pop Add To )}] - Postfix & Try Again! Push - 5 4 3 2 Postfix = 3 2 * 3 + 4 2 / 2 / - / 1 - 0 Info 5 Max ISP = 4 1 72 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 2 / 2 / - 3 1 - 0 Info 5 Max ISP = 2 0 73 Top
3 2 * 3 + 4 2 / 2 / - 3 - ICP ISP + - 1 2 Infix = 3 * 2 + 3 – 4 / 2 / 2 - 3 * / 3 4 ^ 6 5 ({[ Done Pop Stack & Add To Postfix 7 0 )}] - 5 4 3 2 Postfix = 3 2 * 3 + 4 2 / 2 / - 3 - 1 - 0 Info 5 Max ISP = 2 0 74 Top
75
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ( ICP = 7 Always PUSH opener to stack) ({[ 7 0 )}] - 5 3 2 3 2^ ^ 4 5 4 - * 1* / + 2 * 4 3 2 Postfix = 1 0 Info 5 Max ISP = -1 -1 76 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 3 Postfix = 1 ( 0 Info 5 Max ISP = 0 0 77 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ICP = 1 > ISP = 0 Push + ({[ 7 0 )}] - 5 4 3 2 3 Postfix = 1 ( 0 Info 5 Max ISP = 0 0 78 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 + 1 ( 0 Info 5 Max ISP = 2 1 79 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ICP = 6 > ISP = 2 Push ^ ({[ 7 0 )}] - 5 4 3 2 Postfix = 3 2 + 1 ( 0 Info 5 Max ISP = 2 1 80 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 3 ^ 2 Postfix = 3 2 3 + 1 ( 0 Info 5 Max ISP = 5 2 81 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ICP = 6 > ISP = 5 Push ^ ({[ 7 0 )}] - 5 4 3 ^ 2 Postfix = 3 2 3 + 1 ( 0 Info 5 Max ISP = 5 2 82 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 ^ 3 ^ 2 Postfix = 3 2 3 2 + 1 ( 0 Info 5 Max ISP = 5 2 83 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ICP = 3 < ISP = 5 Pop ^Add To ({[ 7 0 Postfix & Try Again! Pop ^Add To )}] Postfix & Try Again! Push / - 5 4 ^ 3 ^ 2 Postfix = 3 2 3 2 ^ ^ + 1 ( 0 Info 5 Max ISP = 5 3 84 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 (ICP = 7 > ISP = 4 Push ({[ 7 0 Always PUSH opener to stack )}] - 5 4 3 / 2 Postfix = 3 2 3 2 ^ ^ + 1 ( 0 Info 5 Max ISP = 4 2 85 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 5 4 { 3 / 2 Postfix = 3 2 3 2 ^ ^ 4 + 1 ( 0 Info 5 Max ISP = 0 3 86 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ICP = 3 > ISP = 0 Push * ({[ 7 0 )}] - 5 4 { 3 / 2 Postfix = 3 2 3 2 ^ ^ 4 + 1 ( 0 Info 5 Max ISP = 0 3 87 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 (ICP = 7 > ISP = 4 Push ({[ 7 0 Always PUSH opener to stack )}] - 5 * 4 { 3 / 2 Postfix = 3 2 3 2 ^ ^ 4 + 1 ( 0 Info 5 Max ISP = 4 4 88 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - [ 5 * 4 { 3 / 2 Postfix = 3 2 3 2 ^ ^ 4 5 + 1 ( 0 Info 5 Max ISP = 0 5 89 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 (ICP = 1 > ISP = 0 Push ({[ 7 0 Always PUSH opener to stack )}] - [ 5 * 4 { 3 / 2 Postfix = 3 2 3 2 ^ ^ 4 5 + 1 ( 0 Info 5 Max ISP = 0 5 90 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - - 6 [ 5 * 4 { 3 Postfix = 3 2 3 2 ^ ^ 4 5 4 / 2 + 1 ( 0 Info ISP = 1 5 91 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Pop Stack Till Find Matching ({[ 7 0 Opener Add - To Postfix )}] - - 6 [ 5 * 4 { 3 Postfix = 3 2 3 2 ^ ^ 4 5 4 - / 2 + 1 ( 0 Info ISP = 1 5 92 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 (ICP = 1 > ISP = 4 Pop *Add To ({[ 7 0 Postfix & Try Again! Push - )}] - 6 5 * 4 { 3 Postfix = 3 2 3 2 ^ ^ 4 5 4 - * / 2 + 1 ( 0 Info ISP = 4 4 93 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 6 5 * 4 { 3 Postfix = 3 2 3 2 ^ ^ 4 5 4 - * 1 / 2 + 1 ( 0 Info ISP = 2 4 94 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Pop Stack Till Find Matching ({[ 7 0 Opener Add - To Postfix )}] - 6 5 * 4 { 3 Postfix = 3 2 3 2 ^ ^ 4 5 4 - * 1 * / 2 + 1 ( 0 Info ISP = 2 4 95 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Pop Stack Till Find Matching ({[ 7 0 Opener Add - To Postfix )}] - 6 5 4 3 Postfix = / 2 3 2 3 2 ^ ^ 4 5 4 - * 1 * / + + 1 ( 0 Info ISP = 4 2 96 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 (ICP = 3 > ISP = -1 Push * ({[ 7 0 )}] - 6 5 4 3 Postfix = 2 1 3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 0 Info ISP = -1 -1 97 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 Write Operand To Postfix String ({[ 7 0 )}] - 6 5 4 3 Postfix = 2 1 2 3 2 3 2 ^ ^ 4 5 4 - * 1 * / + * 0 Info ISP = 4 0 98 Top
3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * ICP ISP + - 1 2 ( 3 + 2 ^ 3 ^ 2 / { 4 * [ 5 – 4 ] * 1 } ) * 2 * / 3 4 ^ 6 5 ({[ 7 0 )}] - 6 5 Done Pop Stack & Add To Postfix 4 3 Postfix = 2 1 3 2 3 2 ^ ^ 4 5 4 - * 1 * / + 2 * * 0 Info ISP = 4 0 99 Top
What type of stack was to create the Postfix from the Infix? Scala: var st = new charStack(50) Stack <char> Postfix(5); 100
Recommend
More recommend