# 20240408_高级程序设计_小作业8 **Repository Path**: noCH3COOH/20240408_advancedProgramDesign_homework8 ## Basic Information - **Project Name**: 20240408_高级程序设计_小作业8 - **Description**: 高级程序设计_小作业8 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-23 - **Last Updated**: 2024-05-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-24ddc0f5d75046c5622901739e7c5dd533143b0c8e959d652212380cedb1ea36.svg)](https://classroom.github.com/a/VT2Nmnmc) The following algorithm gives how to evaluate a postfix expression. 1) Create a stack to store operands (or values). 2) Scan the given expression and do following for every scanned element. 2a) If the element is a number, push it into the stack 2b) If the element is a operator, pop operands for the operator from stack. Evaluate the operator and push the result back to the stack 3) When the expression is ended, the number in the stack is the final answer In this project, with the code: defs.h, stack.h stack.c provided, one is required to implement the above algorithm in the provided prototype .c file eval_postfix.c, and the provided function prototype: int eval_postfix(int *postfix_exp, int len), where postfix_exp is the integer array holding the postfix expression, and len is the number of elements in the array (recall that this postfix_exp is the product of the previous assignment). Assume that all operands are integers in this project, and division operation '/' will result in integer. a main.c is provided to test the implementation.