for item in 전위표기식 do

if (item이 연산자 op라면)

then push(s,item)

if (item이 피연산자면)

then seccond <- pop(s)

     first <- pop(s)

     result <- second op first

     push(s, result)

final_result <- pop(s);


이게 내가 생각해낸 전위 표기 수식 계산 알고리즘인데

아무리 봐도 아닌 것 같아서 여기에다 물어본다


참고로 참고한 후위 표기 수식 계산 알고리즘은


for item in 후위표기식 do

if (item이 피연산자라면)

then push(s,item)

if (item이 연산자 op라면)

then seccond <- pop(s)

     first <- pop(s)

     result <- first op second

     push(s, result)

final_result <- pop(s);


이거다. 도움 부탁한다