Data Structures Using C++: Using the Stack to create a RPN (post-fix notation) Calculator

  Рет қаралды 93,645

ReelLearning

ReelLearning

Күн бұрын

Пікірлер: 41
@markksantos
@markksantos 3 жыл бұрын
THIS IS AMAZING! THANKS PLEASE MAKE MORE VIDEOS LIKE THIS!
@airplanefreak27
@airplanefreak27 11 жыл бұрын
This is EXTREMELY helpful!
@ReelLearning
@ReelLearning 12 жыл бұрын
In general you should declare variables in the narrowest scope as possible - I don't always follow this rule myself, but I did in this case. A good compiler will not produce anymore overhead for declaring the num variable inside the loop. As far as using a try/catch, you may be right... I don't remember my thought process at the time, but maybe I planned to do a separate video on exceptions and the try/catch.
@AbdelrahmanRashed
@AbdelrahmanRashed 8 жыл бұрын
Thanks , your program really helped me in writing on my Android Calculator , Thanks again man.
@dbf8014
@dbf8014 5 жыл бұрын
when you just compiled the program what happens if i wanna do 1.2 - (subtract) 2.9 q (quit) ???
@LukusGames
@LukusGames 3 жыл бұрын
What a fantastic video
@_ZeRoYa_
@_ZeRoYa_ 6 жыл бұрын
Thank you very much for a great video and your clear explanation!
@georgepatsias
@georgepatsias 9 жыл бұрын
Very helpful!!! Thanks very MUCH!
@EmZvr
@EmZvr 11 жыл бұрын
Very good explanation, thank you.
@Shockszzbyyous
@Shockszzbyyous 9 жыл бұрын
so every time isOperator is called the string will be allocated space and the symbols loaded? or is the compiler smart enough to see that and just load it once outside the scope of the program and just use a pointer for it ? or am i totally getting it wrong here :D
@thinkb4uclick_780
@thinkb4uclick_780 6 жыл бұрын
thank you for this vid! it helps alot 😊
@badpeq
@badpeq 11 жыл бұрын
This helped a lot, thanks!
@RootForums
@RootForums 6 жыл бұрын
You sound like Bill Gates... Thank you for the tutorial !!
@danielmejia4054
@danielmejia4054 2 жыл бұрын
Sooo good
@rady90
@rady90 10 жыл бұрын
What if you divide by zero? Goodbye processor?
@jamesbones1668
@jamesbones1668 6 жыл бұрын
outstanding. thanks.
@kim15742
@kim15742 8 жыл бұрын
Is there no other way of translating the operator char into an actual operator? I have those long else if stacks...
@aggbak1
@aggbak1 7 жыл бұрын
use a map that has a string for a key and a pointer to a function with two doubles as arguments and returns a double.
@shojibmahmud9667
@shojibmahmud9667 7 жыл бұрын
If I want to do some operations with Trigonometric operators then what should to do?
@andeluuledna
@andeluuledna 9 жыл бұрын
thanks a lot!
@insect212
@insect212 10 жыл бұрын
Why use stack instead of vector? Vector gets better performance.
@jpkfox
@jpkfox 10 жыл бұрын
Performance does not need to be considered here as the number of calculations is small and is human driven program. Trimming programs is normally not needed until there is a real need for it. Makes code better structured by using stack I would say. So I think I would also use stack.
@insect212
@insect212 10 жыл бұрын
jpkfox Ah I see.
@jpkfox
@jpkfox 10 жыл бұрын
Brock X Because the argument could be set also that making the program even faster we could add some assembly code in it instead of C++ code. Yes it would be even faster, but it would be harder to read for programmers. And that is the whole purpose of C++: to make code better structured and more readable. Sometimes it means a bit worse performance, but we sacrifice it a bit sometimes to get better looking code. But again it depends.. if performance was really needed, then yes we would need to trim it and do it even if the code looks less structured.
@insect212
@insect212 10 жыл бұрын
jpkfox I'm glad I chose to use vectors then. I am making a program that requires millions of calculations, so performance is important.
@jpkfox
@jpkfox 10 жыл бұрын
Brock X Yes sure if its millions of operations per second, then must read the documentation and check which is fastest. But with this calculator its not the case... its only couple of operations per second required.
@TheWeepingCorpse
@TheWeepingCorpse 9 жыл бұрын
why do you say pound include instead of hash include. # = hash, £ = pound.
@Witteplaag
@Witteplaag 7 жыл бұрын
Can't be certain, but I believe it's an American thing. I knew "#" all my life as "pound" until twitter came along.
@TheBoomersauce
@TheBoomersauce 6 жыл бұрын
Americans dont have £ on our keyboards so we can call # pound without a name conflict. As to why we call it pound i think it has something to do with telephones
@sirkastic
@sirkastic 6 жыл бұрын
Because we aren't all British Wankers
@kevinozocak4349
@kevinozocak4349 7 жыл бұрын
how can i change the programm to use also e function ? example: 3e-2... ?
@MegaBdboy
@MegaBdboy 7 жыл бұрын
How can i transform this code in prefix polish notation not revers ?
@majesticbarrack5506
@majesticbarrack5506 8 жыл бұрын
is it works on variables?
@irvansuryadi3640
@irvansuryadi3640 6 жыл бұрын
may i get the codde
@matusivanovic5992
@matusivanovic5992 10 жыл бұрын
heya i wrote EVRYTHIN like in dis wideo, and 5 4 + printed out 1.25 WOOOT
Data Structures: Queue (Abstract Data Type)
7:14
ReelLearning
Рет қаралды 93 М.
Stack Data Structure In STL | C++ Tutorial
16:59
Portfolio Courses
Рет қаралды 17 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 36 МЛН
БУ, ИСПУГАЛСЯ?? #shorts
00:22
Паша Осадчий
Рет қаралды 3 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,7 МЛН
Data Structures Using C++: Traversing a Linked List
17:57
ReelLearning
Рет қаралды 51 М.
Reverse Polish Notation and The Stack - Computerphile
13:32
Computerphile
Рет қаралды 308 М.
Infix to Postfix using stack
18:20
mycodeschool
Рет қаралды 756 М.
Data Structures Using C++: STL Stack Class
8:29
ReelLearning
Рет қаралды 129 М.
Shunting-yard and Postfix Calculator Algorithms
9:51
Andrés Alonso Contés
Рет қаралды 15 М.
Vectors in C++
16:01
ReelLearning
Рет қаралды 275 М.
How to Create a Linked List C++ Introduction to Linked Lists
12:24
Paul Programming
Рет қаралды 938 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 836 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 36 МЛН