title
3.6 Infix to Postfix using Stack | Data Structures Tutorials
description
In this lecture, I have discussed an efficient algorithm to convert infix to postfix using stack in data structure.
DSA Full Course: https: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bbKJzrsKfMpo_grxuLl8LU
******************************************
See Complete Playlists:
C Programming Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31a8UcMN9-35ghv8qyFWD9_S
C++ Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YU5Wx1dopka58teWP9aCee
Python Full Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bZSiqiOL5ta39vSnBxpOPT
Printing Pattern in C: https://www.youtube.com/playlist?list=PLdo5W4Nhv31Yu1igxTE2x0aeShbKtVcCy
DAA Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31ZTn2P9vF02bkb3SC8uiUUn
Placement Series: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YvlDpJhvOYbM9Ap8UypgEy
Dynamic Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31aBrJE1WS4MR9LRfbmZrAQu
Operating Systems: //www.youtube.com/playlist?list=PLdo5W4Nhv31a5ucW_S1K3-x6ztBRD-PNa
DBMS: https://www.youtube.com/playlist?list=PLdo5W4Nhv31b33kF46f9aFjoJPOkdlsRc
********************************************
Connect & Contact Me:
Facebook: https://www.facebook.com/Jennys-Lectures-CSIT-Netjrf-316814368950701/
Quora: https://www.quora.com/profile/Jayanti-Khatri-Lamba
Instagram: https://www.instagram.com/jayantikhatrilamba/
#jennyslectures #gatecs #dsa
detail
{'title': '3.6 Infix to Postfix using Stack | Data Structures Tutorials', 'heatmap': [{'end': 448.256, 'start': 395.044, 'weight': 0.783}, {'end': 498.449, 'start': 459.085, 'weight': 0.753}, {'end': 675.174, 'start': 640.685, 'weight': 0.722}, {'end': 710.315, 'start': 686.367, 'weight': 0.736}, {'end': 791.202, 'start': 772.557, 'weight': 0.719}, {'end': 1199.547, 'start': 1173.463, 'weight': 0.714}], 'summary': 'Tutorial covers infix to postfix conversion using a stack, emphasizing operator precedence, associativity, and reduction in scans, demonstrating step-by-step conversion, and explaining the algorithm for operator precedence, along with evaluating postfix expressions and converting infix expressions to postfix notation.', 'chapters': [{'end': 41.119, 'segs': [{'end': 41.119, 'src': 'embed', 'start': 0.47, 'weight': 0, 'content': [{'end': 4.195, 'text': 'So the topic is infix to postfix conversion using stack.', 'start': 0.47, 'duration': 3.725}, {'end': 7.259, 'text': 'I have already uploaded one video on this topic, right?', 'start': 4.315, 'duration': 2.944}, {'end': 16.512, 'text': "But I'm getting some comments and mails to make a video on this topic again by following that proper tabular method, right?", 'start': 7.92, 'duration': 8.592}, {'end': 22.98, 'text': 'so now again in this video, we will discuss how to convert an infix expression to postfix expression.', 'start': 17.173, 'duration': 5.807}, {'end': 27.925, 'text': 'right, see, it is not compulsory that you have to use stack for this conversion.', 'start': 22.98, 'duration': 4.945}, {'end': 33.091, 'text': 'without using stack also, you can convert this expression from infix to postfix.', 'start': 27.925, 'duration': 5.166}, {'end': 34.432, 'text': 'so that thing also we will discuss.', 'start': 33.091, 'duration': 1.341}, {'end': 36.414, 'text': 'and what is the drawback of that method?', 'start': 34.432, 'duration': 1.982}, {'end': 38.096, 'text': 'that thing also we will discuss.', 'start': 36.414, 'duration': 1.682}, {'end': 41.119, 'text': 'right, and after that we will discuss this method.', 'start': 38.096, 'duration': 3.023}], 'summary': 'The video discusses infix to postfix conversion using stack, addressing comments and mails for proper tabular method, and also covers converting without using stack and discussing its drawbacks.', 'duration': 40.649, 'max_score': 0.47, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs470.jpg'}], 'start': 0.47, 'title': 'Infix to postfix conversion', 'summary': 'Covers infix to postfix conversion using a stack, addressing viewer requests for a video on the proper tabular method and discussing the use of stack and alternatives for conversion.', 'chapters': [{'end': 41.119, 'start': 0.47, 'title': 'Infix to postfix conversion', 'summary': 'Covers the infix to postfix conversion using a stack, addressing viewer requests for a video on the proper tabular method and discussing the use of stack and alternatives for conversion.', 'duration': 40.649, 'highlights': ['The video addresses viewer requests for a video on the proper tabular method.', 'The chapter covers the infix to postfix conversion using a stack.', 'The chapter discusses the use of stack and alternatives for conversion.']}], 'duration': 40.649, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs470.jpg', 'highlights': ['The chapter covers the infix to postfix conversion using a stack.', 'The video addresses viewer requests for a video on the proper tabular method.', 'The chapter discusses the use of stack and alternatives for conversion.']}, {'end': 402.506, 'segs': [{'end': 96.336, 'src': 'embed', 'start': 41.119, 'weight': 1, 'content': [{'end': 49.745, 'text': 'so now, first of all, the prerequisite of this video is you must know the precedence and associativity chart of the operators right,', 'start': 41.119, 'duration': 8.626}, {'end': 54.348, 'text': 'because here the rule is we are going to convert this expression into postfix,', 'start': 49.745, 'duration': 4.603}, {'end': 58.631, 'text': 'based on that precedence of the operators and associativity of the operators.', 'start': 54.348, 'duration': 4.283}, {'end': 61.413, 'text': 'you must know these things right.', 'start': 58.631, 'duration': 2.782}, {'end': 68.652, 'text': 'so here see the topmost precedences of this parenthesis operator right.', 'start': 61.413, 'duration': 7.239}, {'end': 72.255, 'text': 'second is this exponential operator.', 'start': 68.652, 'duration': 3.603}, {'end': 83.183, 'text': 'on third precedence, we have divide and this multiplication, or you can say s to x operator, and at last in this expression we have minus and plus,', 'start': 72.255, 'duration': 10.928}, {'end': 89.689, 'text': 'right. so precedence is something like this first of all for this parenthesis, then we have exponent,', 'start': 83.183, 'duration': 6.506}, {'end': 94.614, 'text': 'then we have divide and this multiplication then plus and minus.', 'start': 89.689, 'duration': 4.925}, {'end': 96.336, 'text': 'this is the precedence of these operators.', 'start': 94.614, 'duration': 1.722}], 'summary': 'Converting expression to postfix based on operator precedence and associativity chart.', 'duration': 55.217, 'max_score': 41.119, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs41119.jpg'}, {'end': 151.19, 'src': 'embed', 'start': 122.547, 'weight': 2, 'content': [{'end': 126.148, 'text': 'I hope you know what is infix expression, what is postfix expression.', 'start': 122.547, 'duration': 3.601}, {'end': 128.669, 'text': 'See in this case I am going to tell you.', 'start': 127.108, 'duration': 1.561}, {'end': 135.386, 'text': 'this this these are what operands right and these plus, minus, exponential.', 'start': 129.645, 'duration': 5.741}, {'end': 137.907, 'text': 'these are what operators right.', 'start': 135.386, 'duration': 2.521}, {'end': 147.789, 'text': 'so if this operator is between these operands, then it is known as infix expression.', 'start': 137.907, 'duration': 9.882}, {'end': 151.19, 'text': 'what about post fix expression?', 'start': 147.789, 'duration': 3.401}], 'summary': 'Infix and postfix expressions defined with operands and operators.', 'duration': 28.643, 'max_score': 122.547, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs122547.jpg'}, {'end': 283.644, 'src': 'embed', 'start': 252.806, 'weight': 0, 'content': [{'end': 254.567, 'text': 'So this is what a time consuming process.', 'start': 252.806, 'duration': 1.761}, {'end': 263.411, 'text': 'Now I want a process, a processor, a method in which I need to scan this expression only once.', 'start': 255.067, 'duration': 8.344}, {'end': 266.453, 'text': 'So you can do this conversion using stack.', 'start': 263.991, 'duration': 2.462}, {'end': 267.914, 'text': 'only once.', 'start': 267.253, 'duration': 0.661}, {'end': 273.377, 'text': 'you need to scan this infix expression from here to here.', 'start': 267.914, 'duration': 5.463}, {'end': 280.061, 'text': 'once you reach here till the end of this expression, you will get post fix expression in just one scan only right.', 'start': 273.377, 'duration': 6.684}, {'end': 283.644, 'text': 'that is why we are using this is the efficient algorithm you can see.', 'start': 280.061, 'duration': 3.583}], 'summary': 'Efficient algorithm for converting infix to postfix expression using stack in one scan.', 'duration': 30.838, 'max_score': 252.806, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs252806.jpg'}], 'start': 41.119, 'title': 'Infix to postfix conversion', 'summary': 'Discusses operator precedence, associativity, and conversion of infix to postfix expressions using different methods. it emphasizes the importance of understanding these concepts for an efficient conversion process, showcasing examples and highlighting the reduction in scans with the use of stacks.', 'chapters': [{'end': 96.336, 'start': 41.119, 'title': 'Operator precedence and postfix conversion', 'summary': 'Discusses the precedence and associativity of operators and how to convert an expression into postfix based on this precedence. it emphasizes the importance of understanding these concepts for the conversion process.', 'duration': 55.217, 'highlights': ['The chapter emphasizes the importance of knowing the precedence and associativity of operators for converting an expression into postfix.', 'It explains the precedence of operators, with parentheses having the highest precedence followed by the exponent, division, multiplication, and finally addition and subtraction.']}, {'end': 199.011, 'start': 96.336, 'title': 'Infix to postfix conversion', 'summary': 'Discusses the conversion of infix to postfix expressions without using a stack, using a simple example of a plus b multiplication c, highlighting the associativity of operators and demonstrating the conversion process.', 'duration': 102.675, 'highlights': ["The postfix expression of A plus B multiplication C without using a stack would be 'B C A * +', showcasing the conversion process without the need for a stack.", 'The chapter emphasizes the distinction between infix and postfix expressions, defining infix as operators between operands and postfix as operators after the operands.', 'The discussion involves determining the precedence of operators to effectively convert the given infix expression to postfix.']}, {'end': 402.506, 'start': 199.011, 'title': 'Infix to postfix conversion', 'summary': 'Explains the process of converting an infix expression to postfix using stack, which reduces the number of scans required from multiple to just one, leading to an efficient algorithm for the conversion.', 'duration': 203.495, 'highlights': ['The process of converting an infix expression to postfix using stack reduces the number of scans required from multiple to just one, leading to an efficient algorithm for the conversion. The chapter explains the process of converting an infix expression to postfix using stack, which reduces the number of scans required from multiple to just one, leading to an efficient algorithm for the conversion.', 'Explanation of the rules for converting infix to postfix, including handling operands and operators based on precedence. Explanation of the rules for converting infix to postfix, including handling operands and operators based on precedence.', 'Importance of understanding the rules of conversion before starting the process. Importance of understanding the rules of conversion before starting the process.']}], 'duration': 361.387, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs41119.jpg', 'highlights': ['The process of converting an infix expression to postfix using stack reduces the number of scans required from multiple to just one, leading to an efficient algorithm for the conversion.', 'The chapter emphasizes the importance of knowing the precedence and associativity of operators for converting an expression into postfix.', 'The chapter emphasizes the distinction between infix and postfix expressions, defining infix as operators between operands and postfix as operators after the operands.', 'The chapter explains the process of converting an infix expression to postfix using stack, which reduces the number of scans required from multiple to just one, leading to an efficient algorithm for the conversion.', 'It explains the precedence of operators, with parentheses having the highest precedence followed by the exponent, division, multiplication, and finally addition and subtraction.', 'The discussion involves determining the precedence of operators to effectively convert the given infix expression to postfix.']}, {'end': 650.169, 'segs': [{'end': 459.085, 'src': 'embed', 'start': 430.767, 'weight': 0, 'content': [{'end': 432.888, 'text': 'So we are not going to push anything into the stack.', 'start': 430.767, 'duration': 2.121}, {'end': 435.289, 'text': 'Directly write down in the postfix expression.', 'start': 432.928, 'duration': 2.361}, {'end': 436.309, 'text': 'Now next is minus.', 'start': 435.329, 'duration': 0.98}, {'end': 438.971, 'text': 'See, now the incoming operator is minus.', 'start': 436.61, 'duration': 2.361}, {'end': 442.132, 'text': 'Now we cannot directly push this minus into the stack.', 'start': 439.411, 'duration': 2.721}, {'end': 444.253, 'text': 'First of all check the precedence right?', 'start': 442.452, 'duration': 1.801}, {'end': 448.256, 'text': 'now plus and minus both are having same precedence.', 'start': 444.893, 'duration': 3.363}, {'end': 450.018, 'text': 'then what you will do now?', 'start': 448.256, 'duration': 1.762}, {'end': 453, 'text': 'check the associativity of these operators.', 'start': 450.018, 'duration': 2.982}, {'end': 457.504, 'text': 'see if associativity is left to right.', 'start': 453, 'duration': 4.504}, {'end': 459.085, 'text': 'in that case, what you will do?', 'start': 457.504, 'duration': 1.581}], 'summary': 'In postfix expression, handle incoming minus operator based on precedence and associativity.', 'duration': 28.318, 'max_score': 430.767, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs430767.jpg'}, {'end': 498.449, 'src': 'heatmap', 'start': 459.085, 'weight': 0.753, 'content': [{'end': 463.329, 'text': 'you will not directly push this operator, this incoming operator, here.', 'start': 459.085, 'duration': 4.244}, {'end': 467.072, 'text': 'first of all you need to pop this operator from the top of the stack.', 'start': 463.329, 'duration': 3.743}, {'end': 469.021, 'text': 'then you can push.', 'start': 468.041, 'duration': 0.98}, {'end': 472.862, 'text': 'or you can say then again, we will check with the new top of the stack right.', 'start': 469.021, 'duration': 3.841}, {'end': 478.744, 'text': 'if associativity is right to left, then you can push that operator into the stack.', 'start': 472.862, 'duration': 5.882}, {'end': 486.206, 'text': 'if, suppose, suppose the associativity of plus and minus is right to left, then no need to pop directly push plus, then directly push.', 'start': 478.744, 'duration': 7.462}, {'end': 489.107, 'text': 'here already we have plus, directly push minus.', 'start': 486.206, 'duration': 2.901}, {'end': 490.447, 'text': 'but see, this is not the case.', 'start': 489.107, 'duration': 1.34}, {'end': 492.288, 'text': 'associativity is left to right.', 'start': 490.447, 'duration': 1.841}, {'end': 494.948, 'text': 'so now first of all pop this plus.', 'start': 492.288, 'duration': 2.66}, {'end': 498.449, 'text': 'it means we have popped out this plus from the stack.', 'start': 494.948, 'duration': 3.501}], 'summary': 'To push incoming operator, pop top of stack. check associativity for pushing. example of left to right associativity.', 'duration': 39.364, 'max_score': 459.085, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs459085.jpg'}, {'end': 578.246, 'src': 'embed', 'start': 531.075, 'weight': 1, 'content': [{'end': 534.936, 'text': 'see. actually, stack is something like this logical representation.', 'start': 531.075, 'duration': 3.861}, {'end': 536.457, 'text': 'so you can here write down.', 'start': 534.936, 'duration': 1.521}, {'end': 540.377, 'text': 'here we have minus And this precedence is higher.', 'start': 536.457, 'duration': 3.92}, {'end': 548.844, 'text': 'If precedence of incoming operator is higher than the top of the stack, this operator, then you can simply push the incoming operator here.', 'start': 540.897, 'duration': 7.947}, {'end': 549.885, 'text': 'No need to do anything.', 'start': 549.004, 'duration': 0.881}, {'end': 552.747, 'text': "Right? But here I'm short of the space.", 'start': 550.445, 'duration': 2.302}, {'end': 555.129, 'text': "That is why here I'm drawing it something like this.", 'start': 552.787, 'duration': 2.342}, {'end': 556.77, 'text': 'Here we have minus, here we have asterisk.', 'start': 555.189, 'duration': 1.581}, {'end': 558.852, 'text': 'You can say something like this.', 'start': 557.551, 'duration': 1.301}, {'end': 561.014, 'text': 'This is now the stack in horizontal direction.', 'start': 559.132, 'duration': 1.882}, {'end': 563.716, 'text': "I'm representing it right now.", 'start': 561.054, 'duration': 2.662}, {'end': 567.315, 'text': 'Here we have KL plus and M.', 'start': 564.332, 'duration': 2.983}, {'end': 572.86, 'text': 'Now after that we have after this I have N.', 'start': 567.315, 'duration': 5.545}, {'end': 577.145, 'text': 'This we directly write down in postfix because this is what operand.', 'start': 572.86, 'duration': 4.285}, {'end': 578.246, 'text': 'Now we have plus.', 'start': 577.485, 'duration': 0.761}], 'summary': 'Explanation of stack representation and operator precedence.', 'duration': 47.171, 'max_score': 531.075, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs531075.jpg'}], 'start': 402.506, 'title': 'Postfix expression conversion', 'summary': 'Explains the process of converting infix expressions to postfix expressions, discussing the precedence and associativity of operators and the stack operations involved in the conversion. it also demonstrates the step-by-step conversion of an arithmetic expression using a stack.', 'chapters': [{'end': 552.747, 'start': 402.506, 'title': 'Postfix expression conversion', 'summary': 'Explains the process of converting infix expressions to postfix expressions, discussing the precedence and associativity of operators and the stack operations involved in the conversion.', 'duration': 150.241, 'highlights': ['The chapter provides a detailed explanation of the process of converting infix expressions to postfix expressions, emphasizing the handling of different operators such as plus, minus, and asterisks.', 'The explanation includes the rules for determining whether to directly push incoming operators into the stack or to pop the top of the stack based on the precedence and associativity of the operators.', 'The chapter also highlights the significance of checking the precedence of incoming operators compared to the top of the stack to determine whether to push the incoming operator into the stack during the conversion process.']}, {'end': 650.169, 'start': 552.787, 'title': 'Postfix notation conversion process', 'summary': 'Explains the process of converting an infix expression to postfix notation using a stack, considering operator precedence and associativity, with an example demonstrating the step-by-step conversion of an arithmetic expression.', 'duration': 97.382, 'highlights': ['The chapter demonstrates the step-by-step process of converting an infix expression to postfix notation, considering operator precedence and associativity.', 'It explains the use of a stack in the conversion process, showing how operators are pushed, popped, and compared based on precedence and associativity.', 'An example of an arithmetic expression is used to illustrate the conversion process, showcasing the application of the conversion rules in a practical scenario.']}], 'duration': 247.663, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs402506.jpg', 'highlights': ['The chapter provides a detailed explanation of converting infix expressions to postfix expressions, emphasizing handling different operators.', 'The explanation includes rules for determining whether to push incoming operators into the stack or to pop based on precedence and associativity.', 'The chapter highlights the significance of checking the precedence of incoming operators compared to the top of the stack during the conversion process.', 'The chapter demonstrates the step-by-step process of converting an infix expression to postfix notation, considering operator precedence and associativity.', 'It explains the use of a stack in the conversion process, showing how operators are pushed, popped, and compared based on precedence and associativity.', 'An example of an arithmetic expression is used to illustrate the conversion process, showcasing the application of the conversion rules.']}, {'end': 818.013, 'segs': [{'end': 678.057, 'src': 'embed', 'start': 650.169, 'weight': 2, 'content': [{'end': 654.33, 'text': 'so you can directly push plus here right now.', 'start': 650.169, 'duration': 4.161}, {'end': 657.655, 'text': 'see, after plus, we have opening bracket.', 'start': 654.33, 'duration': 3.325}, {'end': 662.961, 'text': 'another rule is, if opening bracket comes, then directly push that operator into the stack.', 'start': 657.655, 'duration': 5.306}, {'end': 664.322, 'text': 'no need to check anything.', 'start': 662.961, 'duration': 1.361}, {'end': 675.174, 'text': 'plus. this is in, and here the expression is kl plus, mn, asterisk, minus now now, next is oh, this is operand.', 'start': 664.322, 'duration': 10.852}, {'end': 678.057, 'text': 'so no need to push anything into the stack directly.', 'start': 675.174, 'duration': 2.883}], 'summary': 'Push operators directly into the stack if opening bracket comes, no need to check anything.', 'duration': 27.888, 'max_score': 650.169, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs650169.jpg'}, {'end': 710.315, 'src': 'heatmap', 'start': 686.367, 'weight': 0.736, 'content': [{'end': 692.469, 'text': 'see in stack I have this one now, if this opening bracket is there.', 'start': 686.367, 'duration': 6.102}, {'end': 693.889, 'text': 'after that there is nothing.', 'start': 692.469, 'duration': 1.42}, {'end': 698.531, 'text': 'so whatever operator comes, we will directly push that operator here.', 'start': 693.889, 'duration': 4.642}, {'end': 701.612, 'text': 'no need to check the precedence of this operator.', 'start': 698.531, 'duration': 3.081}, {'end': 710.315, 'text': 'if there is any operator present behind this opening bracket, behind this opening parenthesis, right,', 'start': 701.612, 'duration': 8.703}], 'summary': 'In a stack, operators following an opening bracket are directly pushed without precedence check.', 'duration': 23.948, 'max_score': 686.367, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs686367.jpg'}, {'end': 763.749, 'src': 'embed', 'start': 728.293, 'weight': 1, 'content': [{'end': 734.614, 'text': 'push here exponential, and this would be same right now.', 'start': 728.293, 'duration': 6.321}, {'end': 738.835, 'text': 'next is we have P, nothing.', 'start': 734.614, 'duration': 4.221}, {'end': 740.536, 'text': 'we are going to push here directly.', 'start': 738.835, 'duration': 1.701}, {'end': 744.879, 'text': 'you will write here right now.', 'start': 740.536, 'duration': 4.343}, {'end': 748.081, 'text': 'next comes closing parenthesis.', 'start': 744.879, 'duration': 3.202}, {'end': 761.148, 'text': 'if closing parenthesis comes, then you are going to pop out each operator from the stack one by one until you find any opening parenthesis.', 'start': 748.081, 'duration': 13.067}, {'end': 763.749, 'text': 'right now closing parenthesis is there.', 'start': 761.148, 'duration': 2.601}], 'summary': 'The transcript discusses pushing and popping elements in a stack until a closing parenthesis is found.', 'duration': 35.456, 'max_score': 728.293, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs728293.jpg'}, {'end': 803.787, 'src': 'heatmap', 'start': 772.557, 'weight': 0.719, 'content': [{'end': 775.938, 'text': 'Now we have reached till the opening parenthesis.', 'start': 772.557, 'duration': 3.381}, {'end': 780.52, 'text': 'There is no more operator between opening and closing parenthesis now.', 'start': 776.218, 'duration': 4.302}, {'end': 783.06, 'text': 'So now in stack I have only plus.', 'start': 781.14, 'duration': 1.92}, {'end': 785.561, 'text': 'I have popped out this one.', 'start': 783.42, 'duration': 2.141}, {'end': 791.202, 'text': 'And we are not going to now write down any opening or closing parenthesis.', 'start': 786.061, 'duration': 5.141}, {'end': 792.723, 'text': 'Now I have a streak.', 'start': 791.823, 'duration': 0.9}, {'end': 796.085, 'text': 'Now see in stack I have plus.', 'start': 794.784, 'duration': 1.301}, {'end': 803.787, 'text': 'Now incoming operator precedence is higher than the this precedence of this operator which is present at the top of the stack.', 'start': 796.685, 'duration': 7.102}], 'summary': 'Stack contains only plus operator, no more parentheses. incoming operator has higher precedence than the top of the stack.', 'duration': 31.23, 'max_score': 772.557, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs772557.jpg'}, {'end': 823.838, 'src': 'embed', 'start': 791.823, 'weight': 0, 'content': [{'end': 792.723, 'text': 'Now I have a streak.', 'start': 791.823, 'duration': 0.9}, {'end': 796.085, 'text': 'Now see in stack I have plus.', 'start': 794.784, 'duration': 1.301}, {'end': 803.787, 'text': 'Now incoming operator precedence is higher than the this precedence of this operator which is present at the top of the stack.', 'start': 796.685, 'duration': 7.102}, {'end': 806.949, 'text': 'So if this is the case then directly push this operator.', 'start': 804.308, 'duration': 2.641}, {'end': 810.33, 'text': "Right And here we don't need any update.", 'start': 807.349, 'duration': 2.981}, {'end': 812.071, 'text': 'Simply we will write down this thing.', 'start': 810.39, 'duration': 1.681}, {'end': 815.332, 'text': 'Right After this we have W.', 'start': 812.291, 'duration': 3.041}, {'end': 818.013, 'text': 'Now this is what operand.', 'start': 815.332, 'duration': 2.681}, {'end': 820.654, 'text': 'So directly you will write down here.', 'start': 818.053, 'duration': 2.601}, {'end': 823.838, 'text': 'in the postfix expression.', 'start': 822.677, 'duration': 1.161}], 'summary': 'Explaining the process of pushing an operator onto the stack in a postfix expression.', 'duration': 32.015, 'max_score': 791.823, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs791823.jpg'}], 'start': 650.169, 'title': 'Operator precedence algorithm', 'summary': 'Explains the algorithm for operator precedence, detailing the rules for pushing, checking precedence, and popping operators from the stack, with an example of the process using specific operators.', 'chapters': [{'end': 818.013, 'start': 650.169, 'title': 'Operator precedence algorithm', 'summary': 'Explains the algorithm for operator precedence, detailing the rules for pushing, checking precedence, and popping operators from the stack, with an example of the process using specific operators.', 'duration': 167.844, 'highlights': ['The algorithm outlines rules for directly pushing operators into the stack, such as when encountering opening brackets, and not needing to check precedence in those cases.', 'When a closing parenthesis is encountered, the algorithm dictates popping out operators from the stack until an opening parenthesis is found, and then proceeding without writing any parentheses.', 'The algorithm involves comparing the precedence of an incoming operator with the operator at the top of the stack, and if the incoming operator has a higher precedence, it is directly pushed into the stack.']}], 'duration': 167.844, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs650169.jpg', 'highlights': ['The algorithm involves comparing the precedence of an incoming operator with the operator at the top of the stack, and if the incoming operator has a higher precedence, it is directly pushed into the stack.', 'When a closing parenthesis is encountered, the algorithm dictates popping out operators from the stack until an opening parenthesis is found, and then proceeding without writing any parentheses.', 'The algorithm outlines rules for directly pushing operators into the stack, such as when encountering opening brackets, and not needing to check precedence in those cases.']}, {'end': 1209.235, 'segs': [{'end': 846.794, 'src': 'embed', 'start': 818.053, 'weight': 0, 'content': [{'end': 820.654, 'text': 'So directly you will write down here.', 'start': 818.053, 'duration': 2.601}, {'end': 823.838, 'text': 'in the postfix expression.', 'start': 822.677, 'duration': 1.161}, {'end': 825.899, 'text': 'now we have divide.', 'start': 823.838, 'duration': 2.061}, {'end': 827.26, 'text': 'now check the top of the stack.', 'start': 825.899, 'duration': 1.361}, {'end': 830.142, 'text': 'we have asterisk and incoming operator is divide.', 'start': 827.26, 'duration': 2.882}, {'end': 831.223, 'text': 'take the precedence.', 'start': 830.142, 'duration': 1.081}, {'end': 833.685, 'text': 'precedence of both are safe.', 'start': 831.223, 'duration': 2.462}, {'end': 835.366, 'text': 'then you will check the associativity rule.', 'start': 833.685, 'duration': 1.681}, {'end': 838.388, 'text': 'associativity is what left to right.', 'start': 835.366, 'duration': 3.022}, {'end': 839.809, 'text': 'if left to right is there.', 'start': 838.388, 'duration': 1.421}, {'end': 841.55, 'text': 'then first of all pop out this.', 'start': 839.809, 'duration': 1.741}, {'end': 845.233, 'text': 'after that you can push right.', 'start': 841.55, 'duration': 3.683}, {'end': 846.794, 'text': 'now pop out this asterisk.', 'start': 845.233, 'duration': 1.561}], 'summary': 'Converting infix to postfix, applying associativity and precedence rules', 'duration': 28.741, 'max_score': 818.053, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs818053.jpg'}, {'end': 1064.511, 'src': 'embed', 'start': 1030.955, 'weight': 4, 'content': [{'end': 1032.316, 'text': 'now we have only plus.', 'start': 1030.955, 'duration': 1.361}, {'end': 1034.656, 'text': 'now we are having same precedence operators.', 'start': 1032.316, 'duration': 2.34}, {'end': 1035.818, 'text': 'now check out the associativity.', 'start': 1034.656, 'duration': 1.162}, {'end': 1037.258, 'text': 'associativity is left to right.', 'start': 1035.818, 'duration': 1.44}, {'end': 1041.019, 'text': 'if left to right, then first of all pop out this again.', 'start': 1037.258, 'duration': 3.761}, {'end': 1043.48, 'text': "so i'm writing in this expression only again.", 'start': 1041.019, 'duration': 2.461}, {'end': 1045.32, 'text': 'we will pop out this plus.', 'start': 1043.48, 'duration': 1.84}, {'end': 1048.061, 'text': 'so after popping out plus, we have here plus in the stack.', 'start': 1045.32, 'duration': 2.741}, {'end': 1050.463, 'text': 'now we have nothing right.', 'start': 1048.061, 'duration': 2.402}, {'end': 1052.683, 'text': 'so now simply push this plus here now.', 'start': 1050.463, 'duration': 2.22}, {'end': 1055.184, 'text': 'after this plus, we have q.', 'start': 1052.683, 'duration': 2.501}, {'end': 1056.745, 'text': 'this is what operand.', 'start': 1055.184, 'duration': 1.561}, {'end': 1064.511, 'text': 'so directly you will write down q here, Q here you will write down and in this stack I have now plus.', 'start': 1056.745, 'duration': 7.766}], 'summary': 'Demonstrating stack operations with left-to-right associativity and precedence', 'duration': 33.556, 'max_score': 1030.955, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs1030954.jpg'}, {'end': 1201.008, 'src': 'heatmap', 'start': 1173.463, 'weight': 1, 'content': [{'end': 1178.466, 'text': 'so here the stack would be plus this one and this one and same.', 'start': 1173.463, 'duration': 5.003}, {'end': 1178.987, 'text': 'here the.', 'start': 1178.466, 'duration': 0.521}, {'end': 1182.509, 'text': 'whatever the postfix expression, you write down that thing now.', 'start': 1178.987, 'duration': 3.522}, {'end': 1184.17, 'text': 'after that we have a.', 'start': 1182.509, 'duration': 1.661}, {'end': 1186.011, 'text': 'so we are going to append a here.', 'start': 1184.17, 'duration': 1.841}, {'end': 1188.593, 'text': 'after a, we reach to the end of the expression.', 'start': 1186.011, 'duration': 2.582}, {'end': 1192.541, 'text': 'then you are going to pop out each Operator from the stack one by one.', 'start': 1188.593, 'duration': 3.948}, {'end': 1194.303, 'text': 'First of all pop out this one.', 'start': 1193.122, 'duration': 1.181}, {'end': 1195.984, 'text': 'Then pop out the second exponent.', 'start': 1194.403, 'duration': 1.581}, {'end': 1197.025, 'text': 'Then pop out the plus.', 'start': 1196.024, 'duration': 1.001}, {'end': 1199.547, 'text': 'And now the stack is empty.', 'start': 1197.465, 'duration': 2.082}, {'end': 1201.008, 'text': 'Right Now we are going to stop.', 'start': 1199.767, 'duration': 1.241}], 'summary': 'The process involves appending, popping operators, and stopping when the stack is empty.', 'duration': 45.85, 'max_score': 1173.463, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs1173463.jpg'}], 'start': 818.053, 'title': 'Postfix expressions', 'summary': "Covers evaluating postfix expressions, considering operators' precedence and associativity, with examples. it also explains converting infix expressions to postfix notation, emphasizing stack operations, precedence rules, and providing an example.", 'chapters': [{'end': 969.614, 'start': 818.053, 'title': 'Postfix expression evaluation', 'summary': "Explains the process of evaluating a postfix expression, considering operators' precedence and associativity, and demonstrates the step-by-step evaluation using examples.", 'duration': 151.561, 'highlights': ["The chapter demonstrates the step-by-step evaluation process of a postfix expression, stressing the importance of considering operators' precedence and associativity.", 'The explanation emphasizes the process of checking the precedence and associativity of operators before pushing or popping them from the stack.', 'The chapter provides a detailed walkthrough of evaluating a postfix expression, illustrating the process with examples and highlighting the importance of understanding operator precedence and associativity.']}, {'end': 1209.235, 'start': 970.834, 'title': 'Conversion to postfix notation', 'summary': 'Explains the process of converting an infix expression to a postfix expression, emphasizing the stack operations involved, precedence and associativity rules, and the final postfix expression obtained, with an example and a mention of the upcoming topic on infix to prefix conversion.', 'duration': 238.401, 'highlights': ['The chapter explains the process of converting an infix expression to a postfix expression, emphasizing the stack operations involved, precedence and associativity rules, and the final postfix expression obtained, with an example and a mention of the upcoming topic on infix to prefix conversion.', 'The operator with higher precedence is pushed onto the stack, and the one with lower precedence is popped and appended to the postfix expression, with specific examples and explanations.', 'The associativity of operators, such as left to right or right to left, determines the order of operations and the handling of operators with the same precedence, demonstrated with clear examples.', 'The process includes checking and updating the stack, appending operands to the postfix expression, and finally emptying the stack to obtain the complete postfix expression, illustrated with a step-by-step walkthrough and a final example.', 'The chapter concludes with a mention of the upcoming topic on infix to prefix conversion, signaling the continuation of the learning journey.']}], 'duration': 391.182, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/PAceaOSnxQs/pics/PAceaOSnxQs818053.jpg', 'highlights': ['The chapter provides a detailed walkthrough of evaluating a postfix expression, illustrating the process with examples and highlighting the importance of understanding operator precedence and associativity.', 'The chapter explains the process of converting an infix expression to a postfix expression, emphasizing the stack operations involved, precedence and associativity rules, and the final postfix expression obtained, with an example and a mention of the upcoming topic on infix to prefix conversion.', 'The process includes checking and updating the stack, appending operands to the postfix expression, and finally emptying the stack to obtain the complete postfix expression, illustrated with a step-by-step walkthrough and a final example.', 'The associativity of operators, such as left to right or right to left, determines the order of operations and the handling of operators with the same precedence, demonstrated with clear examples.', 'The explanation emphasizes the process of checking the precedence and associativity of operators before pushing or popping them from the stack.']}], 'highlights': ['The chapter discusses the use of stack and alternatives for conversion.', 'The video addresses viewer requests for a video on the proper tabular method.', 'The chapter covers the infix to postfix conversion using a stack.', 'The chapter emphasizes the importance of knowing the precedence and associativity of operators for converting an expression into postfix.', 'The chapter explains the process of converting an infix expression to postfix using stack, which reduces the number of scans required from multiple to just one, leading to an efficient algorithm for the conversion.', 'The chapter provides a detailed explanation of converting infix expressions to postfix expressions, emphasizing handling different operators.', 'The explanation includes rules for determining whether to push incoming operators into the stack or to pop based on precedence and associativity.', 'The chapter highlights the significance of checking the precedence of incoming operators compared to the top of the stack during the conversion process.', 'The chapter demonstrates the step-by-step process of converting an infix expression to postfix notation, considering operator precedence and associativity.', 'It explains the use of a stack in the conversion process, showing how operators are pushed, popped, and compared based on precedence and associativity.', 'The algorithm involves comparing the precedence of an incoming operator with the operator at the top of the stack, and if the incoming operator has a higher precedence, it is directly pushed into the stack.', 'When a closing parenthesis is encountered, the algorithm dictates popping out operators from the stack until an opening parenthesis is found, and then proceeding without writing any parentheses.', 'The chapter provides a detailed walkthrough of evaluating a postfix expression, illustrating the process with examples and highlighting the importance of understanding operator precedence and associativity.', 'The chapter explains the process of converting an infix expression to a postfix expression, emphasizing the stack operations involved, precedence and associativity rules, and the final postfix expression obtained, with an example and a mention of the upcoming topic on infix to prefix conversion.', 'The process includes checking and updating the stack, appending operands to the postfix expression, and finally emptying the stack to obtain the complete postfix expression, illustrated with a step-by-step walkthrough and a final example.', 'The associativity of operators, such as left to right or right to left, determines the order of operations and the handling of operators with the same precedence, demonstrated with clear examples.', 'The explanation emphasizes the process of checking the precedence and associativity of operators before pushing or popping them from the stack.']}