Skip to content

A Swing based Expression Tree Visualizer demonstrating DSA concepts like infix to postfix conversion and binary tree construction.

Notifications You must be signed in to change notification settings

richapatel28/ExpressionTreeVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌳 Expression Tree Visualizer

A Java and Swing Expression Tree Visualizer project developed as part of the Data Structures and Algorithms (DSA) .
This standalone desktop application demonstrates the construction and visualization of expression trees β€” an essential concept in compiler design and data structures.


πŸ“˜ Project Overview

The Expression Tree Visualizer allows users to:

  • Input an infix expression (e.g., (A+B)*C).
  • Convert it into postfix form automatically.
  • Build and display the corresponding expression tree structure.
  • Visualize the traversals β€” Inorder, Preorder, and Postorder.
  • Understand how operators and operands are arranged in hierarchical form.

πŸ› οΈ Technologies Used

Component Technology
Language Java (JDK 17 or above recommended)
GUI Framework Java Swing
Database (optional) MySQL (via JDBC)
IDE Used IntelliJ IDEA / VS Code / NetBeans / Eclipse
Version Control Git & GitHub

🧩 Features

βœ… Infix to Postfix Expression Conversion
βœ… Expression Tree Construction
βœ… Graphical Tree Visualization using JavaFX
βœ… Traversal Operations (Inorder, Preorder, Postorder)
βœ… Clear Tree & Reset Options
βœ… Optional: Save user expressions in a database using JDBC


πŸ“‚ Project Structure

Dsa_project/ β”‚ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ Main.java β”‚ β”œβ”€β”€ ExpressionTree.java β”‚ β”œβ”€β”€ Node.java β”‚ β”œβ”€β”€ ExpressionConverter.java β”‚ └── TreeVisualizer.java β”‚ β”œβ”€β”€ assets/ β”‚ └── icons, images (if any) β”‚ β”œβ”€β”€ database/ β”‚ └── db_connection.sql (optional) β”‚ └── README.md

yaml Copy code


πŸš€ How to Run

1. **Clone or download** this repository  
   ```bash
   git clone https://github.com/richapatel28/ExpressionTreeVisualizer.git
   
2. Open the project in your preferred IDE (like VS Code or IntelliJ IDEA).

3. Run the Main.java file.

🧠 DSA Concepts Covered :

Stack-based expression conversion (Infix β†’ Postfix) Binary Tree construction Tree Traversals (Inorder, Preorder, Postorder) Recursion Graphical representation of data structures

🎯 Learning Outcome :

This project strengthens the understanding of: Data structure implementation in real applications. Visualizing how compilers interpret mathematical expressions. Integrating frontend (JavaSwing) with backend logic (Java + DSA).

About

A Swing based Expression Tree Visualizer demonstrating DSA concepts like infix to postfix conversion and binary tree construction.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages