Тёмный

What is Reverse Polish Notation (AKA Postfix Notation)? Why is it Important? 

Gary Explains
Подписаться 313 тыс.
Просмотров 4,9 тыс.
50% 1

This is the first in two videos about the Shunting-Yard Algorithm. This famous algorithm converts infix notation math expressions to postfix (or reverse polish notation) expressions. But why would it do that? What is the point? Let's find out.
---
Let Me Explain T-shirt: teespring.com/...
Twitter: / garyexplains
Instagram: / garyexplains
#garyexplains

Опубликовано:

 

9 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 28   
@shanehebert396
@shanehebert396 6 месяцев назад
Back when I was in engineering school, HP calculators were the rage. The HP-28C was released but I couldn't afford one then. When the -28S was released, I saved up my money and bought one and was very happy with it... but then the -48SX was released just a couple months after I got the -28S. Luckily for me, HP had a trade-in program so I got the -48SX. It has been a good calculator. It still sits on my desk and I use it occasionally to this day. I remember writing all kinds of programs for it... teachers usually had the stance of "if you can write a program to do it, you probably understand the problem well enough".
@akarimsiddiqui7572
@akarimsiddiqui7572 5 месяцев назад
That's a good attitude from teachers
@jeraldgooch6438
@jeraldgooch6438 6 месяцев назад
HP introduced the HP35 as the “ electronic slide rule” in about ‘73, while is was studying engineering. With much scrimping and saving I was able to buy on late that year. The RPN was diff at first but very soon became second nature. That device made a huge difference in that I was more able to focus on understanding the material rather than the mechanics of the computations. Thanks for the video!
@bendono
@bendono 6 месяцев назад
When I was in high school in the mid 90s I had a HP48G calculator. It was RPN, which quickly became my preference. I still have it today.
@jk-mm5to
@jk-mm5to 6 месяцев назад
Still have my HP 48 and I love Droid 48. Rpl is an easy stack language.
@user-dp3vz9tq6e
@user-dp3vz9tq6e 6 месяцев назад
I first came across RPN back in the early 80;s when I had a fig-Forth implementation on my Dragon 32 computer. The 6809 was a great processor for running RPN as it had SSP & USP as well as X & Y index registers...... Happy days
@G4GUO
@G4GUO 6 месяцев назад
My first computer was a Wireless World Comp 80 kit which used BURP (Basic Using Reverse Polish).
@antinatalope
@antinatalope 6 месяцев назад
Can't program in forth without RPN. And considering forth is one of the three best languages to work in, I'm super grateful for it.
@SurfinScientist
@SurfinScientist 6 месяцев назад
That is why HP used to have RPN calculators.
@lv_woodturner3899
@lv_woodturner3899 6 месяцев назад
I have an HP 32SII which may be almost 30 years old. It is now my the calculator I use in my shop. It took awhile to get used to HP's RPN but once learned, it was easy to use. No parenthesis. This was an interesting explanation of RPN. I did not know the terms Infix or Postfix before so a lot to be learnt in this video.
@randreas69
@randreas69 6 месяцев назад
Got myself the HP-48 SX at school. The Droid48 app for Androids gets my friends a chuckle, "oh you're on top of things"..
@petermainwaringsx
@petermainwaringsx 6 месяцев назад
I must try that for the nostalga.
@randreas69
@randreas69 6 месяцев назад
@@petermainwaringsx Not only my life my everything, uh I'll add to it the nostalgia. My real machine got overheated by all the example files. I've made two fractals per battery change.
@mrhickman53
@mrhickman53 6 месяцев назад
While I had gotten through college with a slide rule I receive a Sinclair calculator from my younger brother who could not abide by Reverse Polish Notation RPN. However, I was sold immediately. A few years later, when I obtained my first computer with the CPM operating system I purchased an interpreter for SL5, a dialect of Forth, which is a computer language built around RPN. Forth dominated my next 10-15 years of programming. Even today, I use the GNU Galculator in RPN mode. Fossils like me will pass on eventually, leaving the world to the infix crowd. The primary drawback of postfix, or RPN, is the software writer must pay attention to the order of the parameters pushed to the stack. A lot of POP, SWAP and ROTATE actions are in one's future if the order of pushing is not carefully considered.
@GaryExplains
@GaryExplains 6 месяцев назад
That is what the shunting yard algorithm deals with very neatly.
@Chalisque
@Chalisque 6 месяцев назад
In some sense, postfix is how a CPU evaluates things. Consider load r1, [100] load r2,[200] add r3,r1,r2 so the operation instruction comes _after_ the instructions to fetch the operands.
@GaryExplains
@GaryExplains 6 месяцев назад
With a RISC CPU, yes. That is in fact one of the main features of RISC CPUs.
@muddyexport5639
@muddyexport5639 6 месяцев назад
Thanks! Fun example.
@test40323
@test40323 6 месяцев назад
CSC101...that brings me down memory lane. :-)
@johng7rwf419
@johng7rwf419 6 месяцев назад
Used RPN when I wrote Forth programs for safety systems in the 1980's...
@danielcookeb90
@danielcookeb90 6 месяцев назад
Hi Gary, very interesting. First time hearing infix and post/polish fix. Is there a danger with these systems of someone interpreting these completely wrongly? Or a way of seeing code and knowing its one system and not the other. Clearly no "brackets " is a big giveaway? Love your knowledge and desire to up-skill. Thanks for all you do.👍👍
@petermainwaringsx
@petermainwaringsx 6 месяцев назад
I'd forgotten about RPN.
@taipo101
@taipo101 6 месяцев назад
The Sinclair scientific had rpn back in 1978s
@christiantheophanegasore3786
@christiantheophanegasore3786 6 месяцев назад
HP vs texas instruments calculator in sciences school!😂
@byronwatkins2565
@byronwatkins2565 6 месяцев назад
How about 1 2 3 + * ?
@GaryExplains
@GaryExplains 6 месяцев назад
That would be 2+3, and then 5 * 1, so 5.
@GaryExplains
@GaryExplains 6 месяцев назад
But yes, now looking back (as I am preparing the next video) the way that the shunting yard algorithm would convert 1+2*3 is 1 2 3 * + But not 1 2 3 + * as you wrote.
@tonifasth
@tonifasth 6 месяцев назад
The answer in your thumbnail is 42...I mean 7. 😂
Далее
Introduction to Regular Expressions
13:32
Просмотров 25 тыс.
Новый уровень твоей сосиски
00:33
Reverse Polish Notation and The Stack - Computerphile
13:32
The One BIG Reason to Learn Google's Go Language
17:55
Просмотров 158 тыс.
10 FORBIDDEN Sorting Algorithms
9:41
Просмотров 853 тыс.
Reverse Polish Grows on Trees - Computerphile
9:51
Просмотров 93 тыс.
Programming with Math | The Lambda Calculus
21:48
Просмотров 183 тыс.
Why You Should Use ZRAM on Your Raspberry Pi
20:20
Просмотров 19 тыс.