3.9 Evaluation of Prefix and Postfix expressions using Stack | Data Structures

preview_player
Показать описание

In this lecture I have described how we can evaluate prefix and postfix expressions efficiently using stack data structure.


*********************************************
See Complete Playlists:

***********************************************

Connect & Contact Me:

Рекомендации по теме
Комментарии
Автор

Thanks so much!! I was about to flunk my ACSL contest but then I watched this video. Thanks a lot again god bless you, madam.

anthamh
Автор

you are just making our life easier. Thank you.

official-ali
Автор

Hi, i love your teaching style where you have shared so technically, thanks for effective lecture on prefix and postfix.

SaifulIslam-enji
Автор

Thank you so much mam you are making DSA a easier subject

keerthanarajendran
Автор

Beauty with brain ❤️❤️😍
Edit 1: my comment got highlighted 😍❤️

shivamchhabra
Автор

Madam you are very talented and you can teach very clearly, this lecture series is great help to me, thank you lot👍

hashensenevirathna
Автор

In previous video u said first we have to reverse the equation n solve from right to left but here you have directly started with right to left without reverse

HEENARANA-ijmy
Автор

Nice explanation !! Can u plzz give code implementation also.

vaishnavidongare
Автор

Thanks for the Lecture, in addition to it, "-+2*34/[16]^23" in coding it's a must to put a type brakets to define a two or more digit number, otherwise it'll fail; here an example with C# :

public double evaluateString)
{

StringBuilder appendBuilder= new StringBuilder();
int length = evaluateString.Length;

for (int i = length - 1; i >= 0; i--)
{
string c =

if (char.IsDigit(c, 0))
{
double term = Convert.ToSByte(c);
Push(term);
}
else if (c=="]")
{
char join = evaluateString[--i];
while (join!='[')
{
appendBuilder.Insert(0, join);
join = evaluateString[--i];
}


appendBuilder.Clear();
}
else
{
switch (c)
{
case "^":
double first = Pop();
double second = Pop();
double result = Math.Pow(first, second);
Push(result);
break;
case "*":
first = Pop();
second = Pop();
result = first * second;
Push(result);
break;
case "/":
first = Pop();
second = Pop();
result = first / second;
Push(result);
break;
case "+":
first = Pop();
second = Pop();
result = first + second;
Push(result);
break;
case "-":
first = Pop();
second = Pop();
result = first - second;
Push(result);
break;
}
}
}

return Pop();
}

sabitkondakc
Автор

Wow this is so easy to understand. Thank you.

luissalvador
Автор

mam why didn't u give codes for all this expression evaluations😔😔😔

GADDETEJESH
Автор

Ma’am please make a lecture on creating a program for infix to prefix and Infix to postfix expression

supriyavarma
Автор

Thank you very much. You are a genius. 👍👍🔝🔝👌👌🙏🙏

vakhariyajay
Автор

Your work is really appreciatable... Thank you so much mam....

sushma
Автор

Thank you so much for your help 
May God guide you

atabhabibi
Автор

Thanks you mam for making useful video for us

aniketkumar
Автор

Your lecture does wonder for my revision... Thanks jenny👍

mehakgoyal