Coder Social home page Coder Social logo

hussainmansour / evaluatorexpressions Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 18 KB

Application using implemented stack data structure to convert from infix to postfix notations. And evaluate the postfix expression

License: GNU General Public License v3.0

Java 100.00%
data-structures infixtopostfix-expression java postfix-evaluation

evaluatorexpressions's Introduction

Application:
------------

You are required to write a JAVA program that takes a symbolic infix expression as input
and converts it to postfix notation, enter the values of each symbol, evaluates the postfix
expression and outputs the resulting expression and its value. All operands are integer values,
but intermediate results could be floating points. Your program should support the operators
+, -, * and /. Expressions can contain parentheses. You should use the stack implementation
you did in part (A) for any stack data structure needed in the program.

Postfix Vs. Infix Notations:
--------------------------

The standard way of writing expressions is known as infix notation because the binary operator
is placed in-between its two operands.Although infix notation is the most common way of
writing expressions, it is not the one used by compilers to parse expressions. Instead, compilers
typically use a parenthesis-free notation referred to as postfix. In this notation, each operator
appears after its operands.


Evaluating Postfix Expressions:
-------------------------------

The postfix expression is scanned left-to-right. Operands are placed on a stack until an operator
is found. Operands are then removed from the stack, the operation is performed on the operands
and the result is pushed on to the stack. The process continues until the end of expression is
reached.

evaluatorexpressions's People

Contributors

hussainmansour avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.