Git Product home page Git Product logo

binary-expression-evaluator's Introduction

Binary Expression Evaluator

Understanding Recursive Data Structures.

Dependencies

  • Windows 10 / Mac
  • c++11

Description

Essentially, this aims to create a Binary Search Tree in C++, which can be implemented to solve and display Arithmetic Expressions of two possible forms: "A+B" and "AB*" where the operator is positioned to a particular form. This was also intended to test my understanding of other useful data structures such as Stacks and Queues. With this in mind, I was hoping to better understand how a compiler might possibly analyze and parse syntax through a trivial approach.

Screen Shot 2024-02-11 at 10 24 00 PM
Visual

A possible visual interpretation of how an algebraic expression of a particular form utilizes two stacks for distinguishing between operators and operands while treating a subset of an expression as its own subtree, effectively creating a tree while performing traversals and evaluations all in O(N).

Screen Shot 2024-02-11 at 10 28 51 PM
Implementation

Features

  • Arithmetic Expressions can be displayed appropriately with balanced parentheses such as:
  • ((((A+B)-C)+D)*E) or ((4* 2)*(3+6)) where each inner node is an operator and every leaf is an operand.
  • Secondly, while this program is minimal, it does attempt to implement a Map using a BST with key-value pairs of the form:
  • (Key, Value)

Contributing

If you have a suggestion for what should be improved, your contributions will be greatly appreciated. Simply:

  1. Fork the Project
  2. Create your Feature Branch
  3. Commit your Changes
  4. Push to the Branch
  5. Open a Pull Request

Authors

@donnolis

Acknowledgments

I particularly do not have any links to the sources I used in creating this, but these for sure played a crucial role.

  • Stackoverflow
  • Geeksforgeeks
  • Progamiz
  • A C++ textbook

Note

There are perhaps a lot of issues as I didn't really choose to test how certain inputs would break my already buggy code, but for the most part, everything seems to work. Again, this is by no means professional as I was simply messing around and shoving concepts together.

Out of Boredom and curiosity, this is my Creation.

binary-expression-evaluator's People

Contributors

halaway avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

luedev

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.