No video

Evaluation of Prefix and Postfix expressions using stack

  Рет қаралды 629,275

mycodeschool

mycodeschool

Күн бұрын

Пікірлер: 269
@HandledToaster2
@HandledToaster2 4 жыл бұрын
Why can't we get teachers like this in college lol. I'm sure you're tired of hearing but thank you so much for all your videos, you explain everything so well.
@amanmishra-vt8hk
@amanmishra-vt8hk 3 жыл бұрын
Because Our Teachers doesn't belongs to Google. LOL
@HandledToaster2
@HandledToaster2 3 жыл бұрын
@@amanmishra-vt8hk I'm sorry, I don't know what you meant to say
@amanmishra-vt8hk
@amanmishra-vt8hk 3 жыл бұрын
@@HandledToaster2 He works at google.
@HandledToaster2
@HandledToaster2 3 жыл бұрын
@@amanmishra-vt8hk oooh I didn't know that! Makes sense.
@hmm7458
@hmm7458 2 жыл бұрын
@@HandledToaster2 this channel used to run by two individuals unfortunately one passed away in a tragic car accident (Indian roads you know) and other just stop will to continue the channel so he just go to work for google
@adityaojha2701
@adityaojha2701 4 жыл бұрын
You helped a lot of students achieving their goals. You deserve huge respect. Indeed.
@rajanand7047
@rajanand7047 8 жыл бұрын
sir i want to hug you.i watched this video and now i am certain that i will perform better in my exam
@AV-yz2cf
@AV-yz2cf 6 жыл бұрын
xD but really. He's got the best lectures of DS with crystal clear explanations.
@miw879
@miw879 6 жыл бұрын
holy
@jayant9151
@jayant9151 5 жыл бұрын
@NOTyoutuber no u
@rahulsharma-fk8ly
@rahulsharma-fk8ly 4 жыл бұрын
gay.
@ashokgupta3105
@ashokgupta3105 4 жыл бұрын
Great work sir
@mycodeschool
@mycodeschool 10 жыл бұрын
@Maha- You can check the description for link to source code. Pasting it here too: gist.github.com/mycodeschool/7702441
@pgamudha
@pgamudha 9 жыл бұрын
mycodeschool it would be better if you post the prefix evaluation source code too sir!!
@thecodinghustle1006
@thecodinghustle1006 5 жыл бұрын
give this man an oscar!
@arvindpanchal2721
@arvindpanchal2721 4 жыл бұрын
Isn't oscar is for entertainment industry he is teaching us not entertaining, doing much greater work than entertainment
@siddhartharaja9413
@siddhartharaja9413 3 жыл бұрын
@@arvindpanchal2721 :-bhawnao ko samjho!☺️☺️
@danhle7999
@danhle7999 3 жыл бұрын
@@arvindpanchal2721 then give him a Nobel for Education XD
@hamzaashoaib4644
@hamzaashoaib4644 3 жыл бұрын
Done
@mohitpandey4655
@mohitpandey4655 Жыл бұрын
He is not alive 😭
@chirag_soni_07
@chirag_soni_07 3 жыл бұрын
alright, please add one more thank you to your list. And sir i can't express what kind of respect you owe in every students heart.
@peterwan小P
@peterwan小P 2 жыл бұрын
OMG thank you so much! you explained it much better than my college teacher! Thanks for sharing this valuable information with us for free! thanks a lot!
@whacoder725
@whacoder725 Жыл бұрын
Where u study
@bitethebyte
@bitethebyte 2 жыл бұрын
You are awesome sir, You taught me the whole postfix and prefix concept in just 14 minutes including algorithm. Thank you sir
@luxamateuramvs6800
@luxamateuramvs6800 7 жыл бұрын
dude this is the best video i've ever watched, i totally understood everything, you are really good at teaching.
@dragonore2009
@dragonore2009 7 жыл бұрын
You saved me again, I have exam coming up where I have to evaluate these.
@arihantjammar8888
@arihantjammar8888 5 жыл бұрын
Sir your teaching speed is as perfect as it can be.
@AbhishekPandey-yl3bp
@AbhishekPandey-yl3bp 3 жыл бұрын
You gave strength to my self taught programming journey
@ajaychinni3148
@ajaychinni3148 4 жыл бұрын
Even after 7 years he has the short and best video on this topic
@gargrishab
@gargrishab 7 жыл бұрын
thank you sir for such a wonderful ds experience i am seriously obliged thanks
@ManojChausali
@ManojChausali 7 жыл бұрын
Program for prefix evaluation #include #include #include using namespace std; bool isOperand(char C) { if(C>='0' && C
@Camatio
@Camatio 9 жыл бұрын
This was very helpful. You have my thanks, good sir.
@bhagyashreekakwani9508
@bhagyashreekakwani9508 2 жыл бұрын
Your videos help a lot in building the logic !! Thanks a lot!!
@sameerahmed5078
@sameerahmed5078 4 жыл бұрын
I heard he is no more, but he left such good videos, he lives with us as long as these videos help people like us.
@avinashmaurya3625
@avinashmaurya3625 3 жыл бұрын
He is alive. His partner and cofounder of mycodeschool is no more. You can google for "humblefool"
@Juanbaez_
@Juanbaez_ 4 жыл бұрын
Sir, you are the best. If you thought in a University, I would totally go there.
@rishabh8808
@rishabh8808 3 жыл бұрын
You are an amazing teacher. Keep up the amazing work!
@ryanyoung2583
@ryanyoung2583 4 жыл бұрын
This is so well done. Thank you so much for creating these videos.
@imsunilvaghela
@imsunilvaghela 6 жыл бұрын
Hi, Your explanation skills are way greater than any of the youtuber with data-structure videos. I recommend your channel to each of my colleagues whose base seem unclear in data-structures. You have did a great job. I have one query in this lesson. How can we convert an infix expression to pre/postfix expression, which contains an unary operator in it? Please edit your video with this content or please make a separate video for this. Thanks in advance.
@dylanwatkins1158
@dylanwatkins1158 4 жыл бұрын
awesome ! so clear and understanding, thank you so much! the book for computer architecture just makes no sense. your videos are getting me through this class !
@laxmandora8404
@laxmandora8404 2 жыл бұрын
What a voice you got!!What an exaplanation skillsyou got!! Loved it
@AnilSingh-rg2eq
@AnilSingh-rg2eq 8 жыл бұрын
sweet and simple...u make concepts looks so simple..Thanks a lot :)
@563woodcock
@563woodcock 10 жыл бұрын
A small correction in your code.... In else if(IsNumericDigit(expression[i])) don't do int operand = 0; Remove this line otherwise every time the control enters this else if statement it will assign the index of the string to 0 and start reading from the very beginning of the string.
@vijayalakshmi8337
@vijayalakshmi8337 4 жыл бұрын
It's a shame the world lost you so soon. I really wish you be reborn and teach us more.
@curiousenough5906
@curiousenough5906 4 жыл бұрын
what happened?
@MohamedHossam-in1yn
@MohamedHossam-in1yn 4 жыл бұрын
It was his friend Harsha (the co-founder of this channel) who died not him
@bahar2207
@bahar2207 7 ай бұрын
Saved my semester. Thanks
@ahmedsoliman4015
@ahmedsoliman4015 6 жыл бұрын
Thank you! an awesomely detailed explanation, and the visualization was very informative too!
@user-bg1lb2em5z
@user-bg1lb2em5z Жыл бұрын
Best version of explanation
@HeyThereGuy
@HeyThereGuy 4 жыл бұрын
Beautiful tutorial. Very good English. You saved me so much time.
@biswendrajonchhen124
@biswendrajonchhen124 4 жыл бұрын
This is a very crystal clear explanation. Thank you for the video sir.
@mithileshpandit1071
@mithileshpandit1071 4 жыл бұрын
too OP man... You are the best teacher on the planet
@thatoneuser8600
@thatoneuser8600 3 жыл бұрын
10:48 shouldn't it be 9 - 26 which would be -17? I don't understand which operand is the leader when it comes to subtraction.
@TridibSamanta
@TridibSamanta 4 жыл бұрын
Prefix expression evaluation source code in C++ : github.com/tridibsamanta/Data-Structures-and-Algorithms/blob/master/DS/PrefixEvaluation_Stack.cpp Postfix expression evaluation source code in C++ : github.com/tridibsamanta/Data-Structures-and-Algorithms/blob/master/DS/PostfixEvaluation_Stack.cpp
@imjustjoshying
@imjustjoshying 10 жыл бұрын
Nice Video but you made a mistake in the video during "prefix" notation. You popped 5 & 4 and you multiplied them even though the symbol was + addition.
@SandeepVerma1429
@SandeepVerma1429 9 жыл бұрын
printing mistake dear...
@tanishkaachaturvedi2173
@tanishkaachaturvedi2173 2 жыл бұрын
best video on the internet
@mahesh-ve2bp
@mahesh-ve2bp 5 жыл бұрын
There is no words to say Mind blowing explanation
@rohananjaria1009
@rohananjaria1009 4 жыл бұрын
Code for prefix evaluation #include #include #include using namespace std; // Function to evaluate Porefix expression and return output int EvaluatePrefix(string expression); // Function to perform an operation and return output. int PerformOperation(char operation, int operand1, int operand2); // Function to verify whether a character is operator symbol or not. bool IsOperator(char C); // Function to verify whether a character is numeric digit. bool IsNumericDigit(char C); int main() { string expression; cout
@earthisadinosaur2338
@earthisadinosaur2338 Жыл бұрын
truly a godly video my dude
@buddhiniwalakuluarachchi8281
@buddhiniwalakuluarachchi8281 5 жыл бұрын
thank sir.. this is best video for post-fix which i met
@lordstinson8095
@lordstinson8095 3 жыл бұрын
Great video! How do we evaluate prefix/postfix expressions in case of *unary operators* ?
@dumdumbringgumgum2940
@dumdumbringgumgum2940 2 жыл бұрын
in case of prefix the operand immediately succeeding the unary operator. and in case of postfix. the operand immediately preceding the unary operator.
@theneonlotus
@theneonlotus 7 жыл бұрын
great video, very clear description of pre and post fix. found it very useful
@mato4430
@mato4430 2 жыл бұрын
You are absolutely genius
@shaikgousiya2151
@shaikgousiya2151 3 жыл бұрын
You are a good teacher
@moazelsawaf2000
@moazelsawaf2000 4 жыл бұрын
Really thanks a lot sir
@vikramsapate8703
@vikramsapate8703 3 жыл бұрын
Miss you man ............!!!!!
@kumarpriyansh4238
@kumarpriyansh4238 4 жыл бұрын
awesome. Very clear explanation sir.Understood it totally
@Klish47
@Klish47 8 жыл бұрын
amazing..thanku sooo muchh... understood like never before
@AmrendraKumar-ko8yf
@AmrendraKumar-ko8yf 7 жыл бұрын
yeah ..absolutely So, what r u doing these days . job or studying
@shivanshmathur403
@shivanshmathur403 4 жыл бұрын
@@AmrendraKumar-ko8yf are chacha......kaahe itna...thoda sabr karo
@jangandilogout8653
@jangandilogout8653 6 жыл бұрын
Big thanks sir. Very helpful for my exam 😍
@ankitajain4194
@ankitajain4194 6 жыл бұрын
It will be really good if you can explain Time and space complexity too with your videos.
@MYtantrums
@MYtantrums 6 жыл бұрын
on evaluation of postfix, which one did u pop first? 26 or 9, since OP1 should be 9 because it is the first one to pop and OP2 is 26 (following LIFO), please clarify
@jeetbardapurkar4912
@jeetbardapurkar4912 6 жыл бұрын
9 was the first to pop and then 26 was popped. The way he has programmed, op2 holds the value of the element which was popped first and op1 holds the value of the element popped later. You can interchange what op1 and op2 mean when you write your own code.
@iam_a_sad_khan
@iam_a_sad_khan 5 жыл бұрын
I also got confused first but look 9 pops out first as op2 and then 26 pops out as op1. Now perform the operation op1- op2 that is 26- 9. I hope that makes sense.
@amanmalhotra724
@amanmalhotra724 9 жыл бұрын
fab u all did a fab job awesome explanations this has become one of my fav site and videos thanks and keep it up u guys
@PiyushYadav-hf1ec
@PiyushYadav-hf1ec 3 жыл бұрын
Great Explanation👍🏻👍🏻👍🏻👍🏻
@harshmairh495
@harshmairh495 10 жыл бұрын
thank u for this amazing video. u r doing a great job!!
@AvinashKumar-pb2op
@AvinashKumar-pb2op 2 жыл бұрын
Awesome explanation ❤️. Thank you sir 🤩🤩✨.
@culturapoliticaycomputador9999
@culturapoliticaycomputador9999 3 жыл бұрын
Amazing, thank you so much, for this kind of video. God bless you sir.
@yogieanugrah3865
@yogieanugrah3865 8 жыл бұрын
Thanks! you helped me get my homework done. :)
@tree78254
@tree78254 8 жыл бұрын
In evaluation of prefix exp, atlast... If d operator comes, u hav two pop two elements...n here 2nd element is the 2nd operand.. So d final ans should be like -17 right???
@DarkLordAli95
@DarkLordAli95 8 жыл бұрын
thank you so much kumar.
@narmadapasumarthi9190
@narmadapasumarthi9190 8 жыл бұрын
Really excellent explanation. Thank you very much..
@ericnelsonelem5241
@ericnelsonelem5241 5 жыл бұрын
Very illustrative. Thank you!
@eldadkanawa6527
@eldadkanawa6527 3 жыл бұрын
Nice Explanation, Thanks a lot
@lagend0066
@lagend0066 7 жыл бұрын
thanks a lot for so much easy method .....GOD bless you man
@redmood1097
@redmood1097 10 жыл бұрын
Thank you very much it was very helpful .
@taimoorsk
@taimoorsk 4 жыл бұрын
Great teacher 😍😍
@gmunni17
@gmunni17 7 жыл бұрын
for the prefix example, could you not write it as: - 9 + * 5 4 * 2 3 this gives me the same final answer of 17
@vengtCent
@vengtCent 5 жыл бұрын
Great explanation!
@ganapatibiswas5858
@ganapatibiswas5858 4 жыл бұрын
come back mycodeschool
@yashmehan3944
@yashmehan3944 4 жыл бұрын
very well explained, thank you very much!
@btsarmyonly5774
@btsarmyonly5774 3 жыл бұрын
Good explanation sir... Thank you so muchhh
@dearvivekkumar
@dearvivekkumar 10 жыл бұрын
Great explanation as always
@ankitjangid1
@ankitjangid1 8 жыл бұрын
Sir can you please tell how to convert complex expressions into postfix, for ex :- in my book a question is given i.e A*(B+D)/E-F-(G+H/K) and (A+ B ^ D)/(E-F)+G (^ IS NOT POWER). Please help!!
@mohitdaga2356
@mohitdaga2356 6 жыл бұрын
You were a genius,no wonder!
@bolu3307
@bolu3307 5 жыл бұрын
Python implementation of postfix expression evaluation. Note: Parses single-digit numbers only. You may implement your preferred parser for input. #Stack class implementation class stack(): def __init__(self): self.headNode = None def trav(self): if(self.headNode): checkNode = self.headNode print checkNode.data while checkNode.next: next = checkNode.next print next.data checkNode = next def push(self,val): NN = Node(val) NN.next = self.headNode self.headNode = NN def pop(self): if(not self.headNode): return None CNode = self.headNode self.headNode = self.headNode.next return CNode def not_emp(self): if(self.headNode!=None): return True return False def top(self): return self.headNode #import operator module to match operator characters with Arithmetic functions import operator def postfix_eval(exp): #operator dictionary, pairing characters with arithmetic functions operators = {"+":operator.add,"-":operator.sub,"*":operator.mul,"/":operator.div} exp_stack = stack() for i in exp: #if not operator, i.e if operand, add to top of stack if(not i in operators): exp_stack.push(i) else: #if character operator, pop last two top elements in stack, be mindful of the order operand2 = int(exp_stack.pop().data) operand1 = int(exp_stack.pop().data) #call arithmetic operator with character as key in operators dictionary, and pass the last two popped elements as parameters result = operators[i](operand1,operand2) exp_stack.push(result) #when all done, return top(only) element left in stack return exp_stack.pop().data
@rztutul8824
@rztutul8824 7 жыл бұрын
just awesome explanation ....Tnx
@5thbatman
@5thbatman 5 жыл бұрын
great explanation...
@himanshugupte5543
@himanshugupte5543 8 жыл бұрын
You guys are awesome!
@nabilaaziz3446
@nabilaaziz3446 9 жыл бұрын
Good job!! Great explanation. thanks :)
@BladeAndrade
@BladeAndrade 6 жыл бұрын
why at the subtraction you place 26 as operand 1 instead of 9? isn't supposed to pop the topmost elements of the stack? 9 is the topmost and must pop out first then 26 so you will have 9-26, I'm confused.
@tune_into_gaming
@tune_into_gaming 7 жыл бұрын
best explanation...
@shamim-io
@shamim-io 5 жыл бұрын
Thanks.. Helped me a lot!!
@udz26
@udz26 3 жыл бұрын
The prefix expression -+*23+549 is evaluating to 6, not 17... I even checked on online prefix analyzers. Correct me if I am wrong, Edit: Please ignore this, the actual expression is -+*23*549.
@manistrikes
@manistrikes 3 жыл бұрын
Well after 23 it's the multiplication operator and not '+'.
@udz26
@udz26 3 жыл бұрын
@@manistrikes Ohh god... and I was frustrated over why my answer is not 17 🤦🤦🤦
@jameslussier3143
@jameslussier3143 10 жыл бұрын
this was very helpful, thanks a lot
@andreasan1783
@andreasan1783 Жыл бұрын
thanks, very helpful
@SaumyaSharma007
@SaumyaSharma007 3 жыл бұрын
Awesome 🔥🌟🌟🌟🌟🌟
@shantanumaitra8192
@shantanumaitra8192 5 жыл бұрын
Best explanation🤗🤗🤗🤗😘
@ashutoshsingh419
@ashutoshsingh419 8 жыл бұрын
thanks so much for this explanation
@aliesapour79
@aliesapour79 4 жыл бұрын
Thank you so much for your video
@abhishekkumar-so7ww
@abhishekkumar-so7ww 4 жыл бұрын
you have got good vocal cords
@MANISHSHARMA-we2ye
@MANISHSHARMA-we2ye 7 жыл бұрын
lecture is awesome
@cherry-lp8yq
@cherry-lp8yq 4 жыл бұрын
Awesomeeee 😍😍😍😍
@TechnoForbes
@TechnoForbes 8 жыл бұрын
Awesome Explanation .. Thanks a Lot :)
@tigershroff8026
@tigershroff8026 5 жыл бұрын
4:01 there is a mistake. The stack is 26 9 - at the end. It should be popped as 9 - 26 = -17 but it is popped as 26 - 9 = 17. Am I right?
@chinmaykulkarni3817
@chinmaykulkarni3817 9 жыл бұрын
Nicely done
@vijayachaduvula4090
@vijayachaduvula4090 6 жыл бұрын
awesome sir..
@mansitiwari4893
@mansitiwari4893 9 жыл бұрын
in the pseudo code, why do we subtract a '0' from expression[i] while trying to get the value of the numerical digits? line 64.
@juliovalerio4742
@juliovalerio4742 3 жыл бұрын
super clear thank you!
@ultimategaming2689
@ultimategaming2689 2 жыл бұрын
thanks pranam
@AndreKhan716
@AndreKhan716 7 жыл бұрын
Well done!
Infix to Postfix using stack
18:20
mycodeschool
Рет қаралды 748 М.
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 68 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
Please Help Barry Choose His Real Son
00:23
Garri Creative
Рет қаралды 21 МЛН
3. Infix to Postfix Conversion The Easy Way
5:44
Yaar Padha De
Рет қаралды 1,4 МЛН
Infix, Prefix and Postfix
13:38
mycodeschool
Рет қаралды 919 М.
Internet is going wild over this problem
9:12
MindYourDecisions
Рет қаралды 49 М.
3.4 Infix Prefix and Postfix expressions | Data Structures Tutorials
14:14
Jenny's Lectures CS IT
Рет қаралды 979 М.
Infix To Postfix Conversion using Stack |Explained in Tamil
9:06
Data structures: Introduction to Queues
9:19
mycodeschool
Рет қаралды 526 М.
Infix to Postfix conversion using Stacks Data Structures
9:32
ComputerAdx
Рет қаралды 21 М.
Infix to Prefix conversion using Stacks Data Structure
8:42
ComputerAdx
Рет қаралды 292 М.
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 68 МЛН