 The today's topic is prefix to post-fix expression, what we have considered or what we have learned in the previous session that is in fix to post-fix. Now today we will see how to convert prefix expression into post-fix expression. The learning outcome of the today's sessions will be able to convert the prefix expression into the post-fix or it is also called as a suffix expression. The today's contents are, today's contents are, we will see first of all what are the different rules for evaluating post-fix and prefix expressions. Then how to convert the prefix expression into post-fix expression. Let us see the rules for post-fix expression. Find out the leftmost operator in the expression. Select the two operands which are immediately to the left of the binary operators. Then if the operator is unary, select the one or two operands, one operand. If suppose there are binary operator, then select two operands, similar to the left of the unary or binary operator, perform the indicated operation and replace the operators and operands. If suppose the same thing is for prefix, in that case find out the rightmost operator in the expression, then select the two operands which are left to the operator. If suppose the operator is unary, then select the one operand immediately to the right, instead of left, I will be using right. And if suppose the binary operator is there, then select two operands which are right to this binary operator. Perform the indicated operation, replace the operator and operands with the result. This is what the rules for evaluating post-fix as well as the prefix expression. Basically the difference is that for prefix expression evaluation, wherever leftmost is there, we have to put rightmost and whenever left is there, we have to put right. We will get the rules for prefix expression. Now conversion of prefix to post-fix expression. Suppose the given expression is say AND AB, that is AND is prefix. First of all the operator followed by the two operands. So post-fix will be AB AND. So this is AND AB converted into AB AND. Here we observe that operator is scanned initially followed by the two operands, that is A and B. Now consider this question, take a pause in the video and give the answer. Consider following expression, if the operator has the same priority, then which operator will be evaluated first? Now in this case AND or ABC, which operator will be evaluated in prefix expression? So we need to consider rightmost operator, that is that we have to think and give the answer. In case equal priorities, the leftmost operator will be scanned first and then evaluation will be take place. First and the second is AND operator, first is OR, second is AND. Now conversion of prefix to post-fix expression. Let us consider AND or ABC, this is say equation number 1. As per the priority, OR will be evaluated first, OR means find out the rightmost operator. The rightmost operator is OR. Then the two operands which are right to this operator AB, those will be selected. Perform the indicated operation means OR AB will be converted into post-fix, that is OR AB will be converted into post-fix, that is AB OR say that is equal to T1. This is T1 in the expression number 1. So that expression becomes now in place of OR AB will replace as a T1. So it is AND T1C and T1C that is converted back into the post-fix or suffix that is T1C OR say equation number 3. Now in equation number 3, substitute the value of T1, what is the T1 AB OR? So AB OR C AND. So this is a final post-fix expression from the prefix expression. Now let us consider one more example of prefix to post-fix. Now suppose say it is OR A or BC, say this is equation number 1. Now as per the rightmost operator will be evaluated first, this has got the highest priority. This has got the second priority means first of all this OR will be evaluated followed by this OR means OR ABC will be evaluated first means converted into post-fix. Then result of this and A with OR will be done. Let us convert first of all this part OR BC into post-fix. So OR BC convert this into BC OR say this is equal to T1 substitute T1 in equation number 1 in equation number 1. So this is OR A T1 say this is equal to equation number 2. Let us convert this into post-fix. So this will be A T1 OR say this is equal to equation number 3 replace T1 in equation number 3. So A T1 is nothing but BC OR BC OR OR. So this equation number 4 is post-fix expression for the given equation OR A OR A or BC. Let us consider one more example. Now here it is AND A OR B negation C. Now the number of operators are 1, 2, 3, 2 OR are there and one negation is there. Now the rightmost operator is the negation. Rightmost operator is negation means negation C will be evaluated first then this OR will be evaluated second and this AND will be evaluated third. This is how prefix will be converted into post-fix. So let us convert negation C into post-fix. This is C negation say is equal to T1 substitute T1 in equation number 1, equation number 1. Now equation number 1 so this becomes AND A OR B T1 say this is equation number 2. Now let us convert this OR B T1 OR B T1 is equal to B T1 OR say is equal to T2 substitute this T2 in the equation number 2 so this becomes AND A T2 and A T2 so substitute T2 in this equation number 3. So AND A T2 is nothing but T2 is what? T2 is B T1, B T1 OR, B T1 OR. Then now substitute substitute the value of T1 in the equation number 4 so AND A B T1 is nothing but C negation or C negation OR. So the final answer is AND A B C negation OR is the post-fix expression for the given equation number 1 for equation number 1. These are the references. Thank you.