Skip to content

An evaluator for postfix expressions. The evaluator is stack-based, and capable of evaluating correctly formed but otherwise arbitrary arithmetic expressions on integers. The implementation of the stack is done using linked lists.

Notifications You must be signed in to change notification settings

Siddharthj2002/Postfix-Evaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postfix-Evaluator

● Project Description:

An evaluator for postfix expressions. The evaluator is stack-based, and capable of evaluating correctly formed but otherwise arbitrary arithmetic expressions on integers. The implementation of the stack is done using linked-lists.


● Project Goals:

-> Demonstrate understanding of a linked-list-based stack implementation.

-> Use Interfaces and Abstract classes to separate implementation from usage.

-> Understand and implement the core of a stack-based postfix expression evaluator.

-> Experience debugging and testing code.


● Project Background

Postfix Expressions : A postfix expression evaluator takes as input an arithmetic expression, written in postfix notation, and computes and returns the result. Typically arithmetic is written in infix notation, where the operator, such as “+”, is written between the two operands, such as “1 + 5”. Postfix notation* places the operator after the operands. Postfix notation is unambiguous about the order of operations when evaluating an expression, unlike infix notation, which requires rules of operator precedence and parentheses to be unambiguous. For example, the postfix expression: 4 5 7 2 + - * is equivalent to the infix expression: 4 * (5 - (7 + 2))


● Code Structure:

This project contains the following important folders:

-> src: This is the source folder which consists of all the important files and code related to this project.

-> src/test: This is the package folder containing all of the public unit tests.

-> lib: This is where you can find libraries that are included with the project. At the very least you will find two jar files that are used to run the JUnit test framework.


● Contributing

If you want to contribute to this project and make it better with new ideas, your pull request is very welcomed. If you find any issue just put it in the repository issue section, thank you.

About

An evaluator for postfix expressions. The evaluator is stack-based, and capable of evaluating correctly formed but otherwise arbitrary arithmetic expressions on integers. The implementation of the stack is done using linked lists.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages