Reverse Polish Notation Using Stacks

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024

ความคิดเห็น • 23

  • @zahidmalik-ramzan6415
    @zahidmalik-ramzan6415 4 ปีที่แล้ว +41

    The second example : 6 * 3 - (4 - 5) + 2
    I feel like you may have missed something there.
    After closing the parentheses, the addition operator is of equal precedence with the minus operator. So we pop the minus operator and place it on the String while pushing the addition operator on to the Stack.
    So the end answer should be the following? 6 3 * 4 5 - - 2 +
    Am I correct?

    • @erbcomputerscience
      @erbcomputerscience  4 ปีที่แล้ว +17

      Yes that is correct. Thank you for finding this error.

  • @yalmazkhan4773
    @yalmazkhan4773 3 ปีที่แล้ว +6

    you are an excellent teacher...

  • @aarohansharma4551
    @aarohansharma4551 2 ปีที่แล้ว +4

    This was very helpful. Thank you very much for the clear explanation!

  • @watashiwabotadesu3780
    @watashiwabotadesu3780 8 หลายเดือนก่อน +1

    that's very helpful thank you , may allah guide you to the right path

  • @anonymousvevo8697
    @anonymousvevo8697 3 ปีที่แล้ว +9

    12:57 , the minus has been removed by mistake , i guess

  • @Huge_jass
    @Huge_jass 6 หลายเดือนก่อน +1

    it seems that there is small error in example 3. There supposed to be two '-'. 63*45 - - 2+

  • @atrsarst7158
    @atrsarst7158 2 ปีที่แล้ว

    I love your positivity thank you!

  • @jamesliu8548
    @jamesliu8548 4 หลายเดือนก่อน

    A minus sign got inadvertently erased at Example 3. It should be 6 3 * 4 5 - - 2 + (two minuses instead of one).

  • @TanvirMahmudKhan
    @TanvirMahmudKhan 4 ปีที่แล้ว +2

    Great explanation....

  • @johnpaulpineda9821
    @johnpaulpineda9821 2 ปีที่แล้ว

    Very Good Explanation!

  • @lingsun4492
    @lingsun4492 2 ปีที่แล้ว +3

    That is very helpful!!!! thanks!! I also wondering that is "1-(-11)" valid expression? the converted RPN is "1 11 - - " the expected result is 12, but if we evaluate the converted RPN the result is 10. do you know how can we support this kind of expression?

  • @hritikkumar5539
    @hritikkumar5539 7 หลายเดือนก่อน

    this was very helpful TY

  • @dikemahoko8346
    @dikemahoko8346 ปีที่แล้ว +1

    what happened to the string @ 12:56 I think a minus sign disappeared?

  • @undefinedengineer8794
    @undefinedengineer8794 3 ปีที่แล้ว

    supercool! thank you!

  • @MdMasum-si8ib
    @MdMasum-si8ib 3 ปีที่แล้ว

    Example 3 wrong may be
    Missing one minus

  • @baxtables
    @baxtables 3 ปีที่แล้ว

    13:37

  • @anupmerwani9207
    @anupmerwani9207 3 ปีที่แล้ว +1

    bro try getting a better mic, when u say the letter p or b it looks like you are spitting into the mic

  • @lovro_ribic
    @lovro_ribic 7 หลายเดือนก่อน

    can I buy you a new mic?