An open API service indexing awesome lists of open source software.

https://github.com/halaway/binary-expression-evaluator

A BST with implementations for solving expressions and storing information.
https://github.com/halaway/binary-expression-evaluator

Last synced: about 1 year ago
JSON representation

A BST with implementations for solving expressions and storing information.

Awesome Lists containing this project

README

          

# 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._