https://github.com/momattar/parse-tree
Data structure project
https://github.com/momattar/parse-tree
data-structures parse-tree
Last synced: 2 months ago
JSON representation
Data structure project
- Host: GitHub
- URL: https://github.com/momattar/parse-tree
- Owner: momattar
- Created: 2024-08-08T12:37:45.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-08T13:04:14.000Z (9 months ago)
- Last Synced: 2025-01-18T10:44:32.934Z (4 months ago)
- Topics: data-structures, parse-tree
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Parse Tree## Project purpose
To try to find a way to build and evaluate a parse tree if the expression has no parentheses at all.## Main points
First converted the given infix expression to a postfix one, postfix cancels this using precedence as it encodes the operation from the new way it’s written, with no need of parenthesis.If we encounter any arithmetic operators, we create a new binary tree with a root equals to this operator and then we pop twice from the stack to right and left children respectively push this tree to a Stack.
If we encounter operands , we create a new binary tree with a root equals to those operands and push this tree to a Stack.
## Presentation
Here's a powerpoint presentation contains idea, code and running example[Drive link](https://drive.google.com/drive/folders/179Sxg-qJLCuNZxKAqSfmBHPJqMyEYBY2?usp=sharing)